/* ─────────────────────────────────────────────────────────────────────────
   Account Modal — Silver / Mac-style
   Inspired by macOS system panels: clean whites, subtle grays, blue accents.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.account-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem 2rem;
    overflow-y: auto;
}

/* ── Modal shell ─────────────────────────────────────────────────────────── */
.account-modal {
    background: transparent;
    border-radius: 16px;
    box-shadow:
        0 0 0 0.5px rgba(0,0,0,0.12),
        0 4px 16px rgba(0,0,0,0.14),
        0 24px 60px rgba(0,0,0,0.22);
    width: 100%;
    max-width: 620px;
    overflow: hidden;
    animation: acctModalIn 0.18s cubic-bezier(0.3, 0, 0.2, 1);
}

@keyframes acctModalIn {
    from { opacity: 0; transform: translateY(-14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.account-modal-header {
    border-radius: 16px 16px 0 0;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: grab;
}
.account-modal-header:active {
    cursor: grabbing;
}
.account-modal-header button {
    cursor: pointer;
}

.account-modal-title {
    margin: 0;
}

.account-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sign Out — uses shared .frosted-header-btn, red hover is specific */
.account-btn-signout-header:hover {
    background: rgba(255, 59, 48, 0.15);
    border-color: #ff3b30;
    color: #ff3b30;
}

/* close button now uses shared .frosted-close-btn in styles.css */

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.account-tabs {
    background: #f2f2f7;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
    display: flex;
    padding: 0 1.25rem;
    gap: 0.25rem;
}

.account-tab {
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6c6c70;
    cursor: pointer;
    transition: color 0.13s, border-color 0.13s;
    white-space: nowrap;
}
.account-tab:hover    { color: #1c1c1e; }
.account-tab.active   { color: #007aff; border-bottom-color: #007aff; font-weight: 600; }

/* ── Body scroll area ────────────────────────────────────────────────────── */
.account-modal-body {
    background: #f2f2f7;
    border-radius: 0 0 16px 16px;
    padding: 1rem;
    max-height: calc(100dvh - 14rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ── State messages ──────────────────────────────────────────────────────── */
.account-loading,
.account-error,
.account-empty {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.875rem;
    color: #8e8e93;
}
.account-error { color: #ff3b30; }

/* ── Section cards ───────────────────────────────────────────────────────── */
.account-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem 1.125rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.account-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #007aff;
    margin: 0 0 0.75rem;
}
.account-section-title-danger { color: #ff3b30; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.account-form {}

.account-field-row {
    margin-bottom: 0.65rem;
}

.account-field-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.account-field-three {
    display: grid;
    grid-template-columns: 1fr 0.65fr 0.65fr;
    gap: 0.65rem;
}

.account-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #8e8e93;
    margin-bottom: 0.28rem;
    letter-spacing: 0.01em;
}
.account-required { color: #ff3b30; }

.account-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1c1c1e;
    background: #ffffff;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.13s, box-shadow 0.13s;
}
.account-input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14);
}
.account-input:disabled {
    background: #f2f2f7;
    color: #8e8e93;
    cursor: default;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.account-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Primary — macOS blue */
.account-btn-primary {
    background: #007aff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.13s, transform 0.08s;
}
.account-btn-primary:hover    { background: #0066dd; }
.account-btn-primary:active   { transform: scale(0.97); }
.account-btn-primary:disabled { background: #aeaeb2; cursor: not-allowed; transform: none; }
.account-btn-primary.account-btn-saved { background: #34c759; }
.account-btn-primary.account-btn-error { background: #ff3b30; }

/* Secondary — neutral gray */
.account-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: #1c1c1e;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.13s;
}
.account-btn-secondary:hover    { background: rgba(0, 0, 0, 0.11); }
.account-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Danger zone */
.account-section-danger {
    border: 1px solid rgba(255, 59, 48, 0.18);
    background: rgba(255, 59, 48, 0.02);
}

/* ── Subscription info rows ──────────────────────────────────────────────── */
.account-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.38rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.055);
    font-size: 0.875rem;
    color: #1c1c1e;
    gap: 0.5rem;
}
.account-sub-row:last-child { border-bottom: none; }
.account-sub-label          { color: #8e8e93; white-space: nowrap; }

/* Status badges */
.account-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-trial    { background: rgba(255, 159, 10, 0.12); color: #b87a00; }
.badge-active   { background: rgba(52,  199, 89, 0.12); color: #1a7a35; }
.badge-warning  { background: rgba(255,  59, 48, 0.12); color: #cc2200; }
.badge-inactive { background: rgba(142, 142, 147, 0.1); color: #636366; }

/* ── Inline feedback messages ────────────────────────────────────────────── */
.account-msg {
    font-size: 0.8rem;
    margin-top: 0.45rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
}
.account-msg-success { background: rgba(52,  199, 89, 0.1); color: #1a6130; }
.account-msg-error   { background: rgba(255,  59, 48, 0.1); color: #cc1100; }

/* ── List items (churches & missions) ────────────────────────────────────── */
.account-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.055);
}
.account-list-item:last-of-type { border-bottom: none; }

.account-list-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.account-list-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1c1c1e;
}
.account-list-item-sub {
    font-size: 0.75rem;
    color: #8e8e93;
}
.account-list-item-link {
    font-size: 0.75rem;
    color: #007aff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-list-item-link:hover { text-decoration: underline; }

.account-list-delete {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    border: none;
    color: #ff3b30;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.13s;
}
.account-list-delete:hover { background: rgba(255, 59, 48, 0.22); }

/* ── Descriptive text ────────────────────────────────────────────────────── */
.account-blurb {
    font-size: 0.8125rem;
    color: #8e8e93;
    line-height: 1.55;
    margin: 0 0 0.65rem;
}
.account-hint {
    font-size: 0.8125rem;
    color: #8e8e93;
    line-height: 1.55;
    margin: 0;
}
.account-hint a          { color: #007aff; text-decoration: none; }
.account-hint a:hover    { text-decoration: underline; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .account-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .account-modal {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
    }
    .account-field-split,
    .account-field-three {
        grid-template-columns: 1fr;
    }
    .account-modal-body {
        max-height: calc(100dvh - 9rem);
    }
}
