/* My Ekklesia Account — subscriber dashboard */

.account-page {
    align-items: flex-start;
    padding: 1.5rem 1.25rem 2.5rem;
}

.account-layout {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.account-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    color: #fff;
}

.account-header-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.account-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: var(--brand-gradient);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.account-header-brand h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.account-header-brand p {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    opacity: 0.82;
}

.account-header-user {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.account-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.account-user-meta strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
}

.account-user-meta span {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.8;
}

.account-signout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.account-signout:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}

.account-flash {
    margin-bottom: 1rem;
}

.account-flash:empty,
.account-flash[style*="display: none"],
.account-flash[style*="display:none"] {
    display: none !important;
    margin: 0;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.account-panel {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.account-panel-wide {
    grid-column: 1 / -1;
}

.account-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.account-panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1rem;
    flex-shrink: 0;
}

.account-panel-icon svg {
    display: block;
}

.account-panel-icon--subscription {
    background: #f0fdf4;
    color: #059669;
}

.account-panel-icon--keys {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.account-panel-icon--contact {
    background: #fff7ed;
    color: #ea580c;
}

.account-panel-icon--alert {
    background: #fffbeb;
    color: #d97706;
}

.account-panel-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.account-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    line-height: 1.5;
}

.account-panel .account-meta:last-child {
    margin-bottom: 0;
}

.account-panel-body .account-meta {
    margin: 0 0 1rem;
}

.account-panel-highlight {
    border: 1px solid #fde68a;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 40%);
}

.account-profile-alert {
    margin-bottom: 1.25rem;
}

.account-form-actions {
    margin-top: 0.25rem;
}

.account-form-actions .btn-primary {
    width: auto;
    min-width: 8.5rem;
}

.account-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 1rem;
    padding: 1rem 1.125rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    background: #f8fafc;
    border: 1px solid var(--border);
}

.account-summary-plan {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.account-summary-trial {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
}

.status-badge.cancelled {
    background: #fef2f2;
    color: #991b1b;
}

.status-badge.trial {
    background: #fef9c3;
    color: #a16207;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn-secondary:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-danger:hover {
    background: #fee2e2;
}

.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    color: var(--text);
    background: #fff;
    resize: vertical;
    min-height: 7rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.product-key-cards {
    display: grid;
    gap: 1rem;
}

.product-key-card {
    padding: 1.125rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.product-key-card-header {
    margin-bottom: 0.875rem;
}

.product-key-card-header strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}

.product-key-card-apps {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.product-key-display {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.product-key-display code {
    font-size: 0.8125rem;
    word-break: break-all;
}

.product-key-full {
    display: block;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius);
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.45;
}

.product-key-hint {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius);
    background: #e2e8f0;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.product-key-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.875rem;
}

.product-key-note {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.account-empty {
    padding: 1.5rem;
    text-align: center;
    border-radius: var(--radius);
    background: #f8fafc;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.account-empty a {
    color: var(--primary);
    font-weight: 600;
}

.account-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.account-modal[hidden] {
    display: none;
}

.account-modal-panel {
    width: 100%;
    max-width: 28rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
}

.account-modal-panel h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.account-modal-panel p {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.account-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.account-modal-actions .btn-primary,
.account-modal-actions .btn-secondary {
    width: auto;
    flex: 1;
    min-width: 7rem;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-header {
        flex-direction: column;
        align-items: stretch;
    }

    .account-header-user {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .account-form-actions .btn-primary,
    .account-modal-actions .btn-primary,
    .account-modal-actions .btn-secondary {
        width: 100%;
    }
}

.account-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.account-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.account-billing-period {
    margin-bottom: 1rem;
}

.account-billing-total {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.account-billing-alert {
    margin-bottom: 1rem;
}

.account-billing-actions {
    margin-bottom: 1rem;
}
