/**
 * IBC Hub — Estilos Fase 2
 * Mobile first · Igreja Batista Capital
 */

/* ── Reset ───────────────────────────────────────────────── */
#ibc-hub-wrap *,
#ibc-hub-wrap *::before,
#ibc-hub-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

#ibc-hub-wrap {
    --ibc-blue:        #11569D;
    --ibc-blue-dark:   #0D3F74;
    --ibc-blue-mid:    #1A6FBF;
    --ibc-blue-light:  #E8F0FA;
    --ibc-blue-xlight: #F0F5FC;
    --ibc-green:       #2EA965;
    --ibc-green-light: #99C228;
    --ibc-green-bg:    #EAF7F1;
    --ibc-gray:        #718787;
    --ibc-gray-light:  #D1E3CF;
    --ibc-bg:          #F4F7F4;
    --ibc-white:       #FFFFFF;
    --ibc-text:        #1C2B1C;
    --ibc-text-muted:  #6B7F6B;
    --ibc-border:      #D8E5D8;
    --ibc-border-mid:  #BDD0BD;
    --ibc-shadow-sm:   0 1px 3px rgba(17,86,157,.06),0 1px 2px rgba(0,0,0,.04);
    --ibc-shadow:      0 2px 8px rgba(17,86,157,.08),0 1px 3px rgba(0,0,0,.04);
    --ibc-shadow-md:   0 4px 16px rgba(17,86,157,.12),0 2px 6px rgba(0,0,0,.06);
    --ibc-radius-sm: 8px;
    --ibc-radius:    12px;
    --ibc-radius-lg: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ibc-text);
    background: var(--ibc-bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Logo símbolo ─────────────────────────────────────────── */
.ibc-logo-symbol {
    width: 56px; height: 56px;
    background: linear-gradient(145deg, var(--ibc-blue-mid), var(--ibc-blue-dark));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(17,86,157,.3);
    margin: 0 auto 14px;
    flex-shrink: 0;
}
.ibc-logo-symbol svg { width: 32px; height: 32px; }

.ibc-logo-symbol--sm {
    width: 36px; height: 36px;
    border-radius: 10px; margin: 0;
    box-shadow: 0 2px 6px rgba(17,86,157,.25);
}
.ibc-logo-symbol--sm svg { width: 20px; height: 20px; }

/* ══════════════ TELAS DE ACESSO ══════════════ */
.ibc-screen--login,
.ibc-screen--register,
.ibc-screen--lost-password,
.ibc-screen--reset-password {
    min-height: 100vh;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 32px 16px 48px;
    background: var(--ibc-bg);
}

.ibc-access-card {
    width: 100%; max-width: 400px;
    background: var(--ibc-white);
    border-radius: var(--ibc-radius-lg);
    border: 1px solid var(--ibc-border);
    padding: 36px 28px 32px;
    box-shadow: var(--ibc-shadow-md);
}

.ibc-access-header { text-align: center; margin-bottom: 28px; }
.ibc-access-title { font-size: 22px; font-weight: 700; color: var(--ibc-blue-dark); letter-spacing: -.4px; margin-bottom: 4px; }
.ibc-access-subtitle { font-size: 14px; color: var(--ibc-text-muted); }

/* ── Formulários ──────────────── */
.ibc-form { display: flex; flex-direction: column; gap: 14px; }
.ibc-field { display: flex; flex-direction: column; gap: 6px; }
.ibc-label { font-size: 13px; font-weight: 600; color: var(--ibc-text); }

.ibc-input {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1.5px solid var(--ibc-border);
    border-radius: var(--ibc-radius-sm);
    font-size: 15px; color: var(--ibc-text);
    background: var(--ibc-white);
    transition: border-color .15s, box-shadow .15s;
    outline: none; appearance: none; -webkit-appearance: none;
}
.ibc-input:hover { border-color: var(--ibc-border-mid); }
.ibc-input:focus { border-color: var(--ibc-blue); box-shadow: 0 0 0 3px var(--ibc-blue-light); }
.ibc-input::placeholder { color: #A8B8A8; }
textarea.ibc-input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }

.ibc-input-wrap { position: relative; }
.ibc-input-wrap .ibc-input { padding-right: 46px; }

.ibc-eye-btn {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--ibc-gray);
    padding: 4px; display: flex; align-items: center; border-radius: 4px; transition: color .15s;
}
.ibc-eye-btn:hover { color: var(--ibc-blue); }

.ibc-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718787' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

.ibc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Botões ──────────────── */
.ibc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 46px; padding: 0 22px;
    border-radius: var(--ibc-radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer;
    text-decoration: none; border: 1.5px solid transparent;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
}
.ibc-btn:active { transform: scale(.98); }

.ibc-btn--primary { background: var(--ibc-blue); color: #fff; border-color: var(--ibc-blue); box-shadow: 0 2px 8px rgba(17,86,157,.25); }
.ibc-btn--primary:hover { background: var(--ibc-blue-dark); border-color: var(--ibc-blue-dark); box-shadow: 0 3px 10px rgba(17,86,157,.35); }

.ibc-btn--outline { background: transparent; color: var(--ibc-blue); border-color: var(--ibc-blue); }
.ibc-btn--outline:hover { background: var(--ibc-blue-xlight); }

.ibc-btn--ghost { background: transparent; color: var(--ibc-text-muted); border-color: var(--ibc-border); }
.ibc-btn--ghost:hover { background: var(--ibc-bg); border-color: var(--ibc-border-mid); }

.ibc-btn--danger { background: #DC2626; color: #fff; border-color: #DC2626; }
.ibc-btn--danger:hover { background: #B91C1C; border-color: #B91C1C; }

.ibc-btn--full { width: 100%; }
.ibc-btn--sm   { height: 36px; font-size: 13px; padding: 0 14px; }

/* ── Links, alertas, divisor ──── */
.ibc-link { color: var(--ibc-blue); text-decoration: none; font-size: 13px; }
.ibc-link:hover { text-decoration: underline; }
.ibc-link--right  { display: block; text-align: right; }
.ibc-link--center { display: block; text-align: center; margin-top: 16px; }

.ibc-alert {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 14px; border-radius: var(--ibc-radius-sm);
    font-size: 14px; line-height: 1.5; margin-bottom: 4px;
}
.ibc-alert--error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.ibc-alert--success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.ibc-alert--info    { background: var(--ibc-blue-xlight); color: var(--ibc-blue-dark); border: 1px solid var(--ibc-blue-light); }

.ibc-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ibc-text-muted); font-size: 12px; }
.ibc-divider::before, .ibc-divider::after { content:''; flex:1; height:1px; background: var(--ibc-border); }

/* ══════════════ HUB — AGENDA ══════════════ */
.ibc-hub-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: var(--ibc-white);
    border-bottom: 1px solid var(--ibc-border);
    position: sticky; top: 0; z-index: 200;
    box-shadow: var(--ibc-shadow-sm);
}

.ibc-hub-header__brand { display: flex; align-items: center; gap: 10px; }
.ibc-hub-header__titles { display: flex; flex-direction: column; line-height: 1.2; }
.ibc-hub-header__name { font-size: 15px; font-weight: 700; color: var(--ibc-blue-dark); letter-spacing: -.2px; }
.ibc-hub-header__sub  { font-size: 11px; color: var(--ibc-text-muted); text-transform: uppercase; letter-spacing: .6px; }
.ibc-hub-header__actions { display: flex; align-items: center; gap: 10px; }

.ibc-user-info { display: flex; align-items: center; gap: 6px; }
.ibc-user-info__name { font-size: 13px; color: var(--ibc-text-muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ibc-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.ibc-badge--editor { background: var(--ibc-blue-light); color: var(--ibc-blue); }

.ibc-guest-bar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    background: #FFFBEB; border-bottom: 1px solid #FDE68A;
    padding: 10px 16px; font-size: 13px; color: #92400E;
}
.ibc-guest-bar svg { flex-shrink: 0; color: #D97706; }
.ibc-guest-bar .ibc-link { color: #92400E; font-weight: 600; text-decoration: underline; }

.ibc-agenda-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 16px 10px;
}
.ibc-agenda-bar__left { display: flex; align-items: baseline; gap: 10px; }
.ibc-agenda-title { font-size: 20px; font-weight: 700; color: var(--ibc-blue-dark); letter-spacing: -.3px; }
.ibc-event-count { font-size: 12px; color: var(--ibc-text-muted); background: var(--ibc-white); border: 1px solid var(--ibc-border); border-radius: 20px; padding: 2px 9px; }

.ibc-event-list { padding: 4px 16px 48px; }

/* ── Grupo por dia ──── */
.ibc-day-group { margin-bottom: 20px; }

.ibc-day-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
    color: var(--ibc-gray);
    padding: 0 0 9px;
    border-bottom: 1px solid var(--ibc-border); margin-bottom: 10px;
}
.ibc-day-label--today { color: var(--ibc-green); }
.ibc-day-label__prefix { font-weight: 800; }

/* ── Card de evento ──── */
.ibc-event-card {
    display: flex; align-items: stretch;
    background: var(--ibc-white);
    border-radius: var(--ibc-radius);
    border: 1px solid var(--ibc-border);
    margin-bottom: 8px;
    box-shadow: var(--ibc-shadow-sm);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ibc-event-card:hover { border-color: var(--ibc-border-mid); box-shadow: var(--ibc-shadow); transform: translateY(-1px); }
.ibc-event-card--recurring { border-left: 3px solid var(--ibc-green); }

.ibc-event-card__time {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; min-width: 56px; padding: 14px 10px;
    background: var(--ibc-blue-xlight); flex-shrink: 0;
}
.ibc-event-card--recurring .ibc-event-card__time { background: var(--ibc-green-bg); }

.ibc-event-card__start { font-size: 15px; font-weight: 700; color: var(--ibc-blue); line-height: 1; }
.ibc-event-card--recurring .ibc-event-card__start { color: var(--ibc-green); }
.ibc-event-card__sep   { font-size: 9px;  color: var(--ibc-gray); line-height: 1; }
.ibc-event-card__end   { font-size: 11px; color: var(--ibc-text-muted); line-height: 1; }

.ibc-event-card__divider { width: 1px; background: var(--ibc-border); flex-shrink: 0; }

.ibc-event-card__info {
    flex: 1; padding: 12px 14px; min-width: 0;
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.ibc-event-card__title { font-size: 15px; font-weight: 600; color: var(--ibc-text); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibc-event-card__location { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ibc-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibc-event-card__recurring-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ibc-green); }

.ibc-event-card__actions { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; justify-content: center; flex-shrink: 0; }

.ibc-icon-btn {
    width: 30px; height: 30px; border-radius: var(--ibc-radius-sm);
    border: 1px solid var(--ibc-border); background: transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--ibc-gray); transition: background .15s, color .15s, border-color .15s;
}
.ibc-icon-btn:hover        { background: var(--ibc-bg); }
.ibc-btn-edit:hover   { color: var(--ibc-blue); border-color: var(--ibc-blue-light); background: var(--ibc-blue-xlight); }
.ibc-btn-delete:hover { color: #DC2626; border-color: #FECACA; background: #FEF2F2; }

/* ── Estado vazio ──── */
.ibc-empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; color: var(--ibc-text-muted); }
.ibc-empty-state__icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ibc-white); border: 1.5px solid var(--ibc-border); display: flex; align-items: center; justify-content: center; color: var(--ibc-border-mid); margin-bottom: 16px; }
.ibc-empty-state__text { font-size: 15px; margin-bottom: 20px; max-width: 260px; line-height: 1.5; }

/* ══════════════ MODAL ══════════════ */
.ibc-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
    animation: ibcFadeIn .2s ease;
}
@keyframes ibcFadeIn  { from { opacity:0 } to { opacity:1 } }
@keyframes ibcSlideUp { from { transform: translateY(24px); opacity:0 } to { transform: translateY(0); opacity:1 } }

.ibc-modal {
    width: 100%; max-width: 500px;
    background: var(--ibc-white);
    border-radius: var(--ibc-radius-lg) var(--ibc-radius-lg) 0 0;
    padding: 8px 20px 32px;
    max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
    animation: ibcSlideUp .25s cubic-bezier(.16,1,.3,1);
}
.ibc-modal::before { content:''; display:block; width:36px; height:4px; background: var(--ibc-border); border-radius:2px; margin: 12px auto 18px; }

.ibc-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ibc-modal-title  { font-size: 18px; font-weight: 700; color: var(--ibc-blue-dark); letter-spacing: -.3px; }

.ibc-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--ibc-border); }

.ibc-confirm-msg { font-size: 15px; color: var(--ibc-text); line-height: 1.6; margin-bottom: 24px; padding: 16px; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: var(--ibc-radius-sm); }

/* ── Toggle ──── */
.ibc-label--toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--ibc-bg); border: 1.5px solid var(--ibc-border); border-radius: var(--ibc-radius-sm); cursor: pointer; transition: border-color .15s; }
.ibc-label--toggle:hover { border-color: var(--ibc-border-mid); }

.ibc-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.ibc-toggle input { opacity:0; width:0; height:0; position: absolute; }
.ibc-toggle__track { position: absolute; inset:0; background: var(--ibc-border); border-radius:12px; transition: background .2s; cursor: pointer; }
.ibc-toggle__track::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; background:#fff; border-radius:50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ibc-toggle input:checked + .ibc-toggle__track { background: var(--ibc-blue); }
.ibc-toggle input:checked + .ibc-toggle__track::after { transform: translateX(20px); }

/* ── Seção recorrência ──── */
#f-recurrence-wrap { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--ibc-blue-xlight); border: 1px solid var(--ibc-blue-light); border-radius: var(--ibc-radius-sm); margin-top: 4px; }
#f-relative-wrap   { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--ibc-white); border: 1px solid var(--ibc-blue-light); border-radius: var(--ibc-radius-sm); }

/* ══════════════ TOAST ══════════════ */
.ibc-toast { position: fixed; bottom: 28px; left:50%; transform: translateX(-50%) translateY(16px); background: #1C2B1C; color:#fff; font-size:14px; font-weight:500; padding:12px 20px; border-radius:999px; z-index:9999; opacity:0; transition: opacity .22s, transform .22s; white-space:nowrap; max-width:90vw; text-align:center; pointer-events:none; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.ibc-toast--visible { opacity:1; transform: translateX(-50%) translateY(0); }
.ibc-toast--success { background: #166534; }
.ibc-toast--error   { background: #991B1B; }

/* ══════════════ SPINNER ══════════════ */
@keyframes ibcSpin { to { transform: rotate(360deg); } }
.ibc-spinner { animation: ibcSpin .8s linear infinite; }

/* ══════════════ DESKTOP ══════════════ */
@media (min-width: 600px) {
    .ibc-screen--login,
    .ibc-screen--register,
    .ibc-screen--lost-password,
    .ibc-screen--reset-password { align-items: center; padding: 48px 24px; }

    .ibc-agenda-bar,
    .ibc-event-list { max-width: 700px; margin-left: auto; margin-right: auto; width: 100%; }

    .ibc-agenda-bar { padding: 24px 24px 12px; }
    .ibc-event-list { padding-left: 24px; padding-right: 24px; }
    .ibc-hub-header { padding: 12px 24px; }
    .ibc-guest-bar  { padding: 10px 24px; }

    .ibc-modal-overlay { align-items: center; }
    .ibc-modal { border-radius: var(--ibc-radius-lg); max-height: 85vh; }
    .ibc-modal::before { display: none; }
}
