/* =============================================================
   ACCOUNTS / PORTAL CSS
   Append this to the END of static/css/style.css
   or include via a separate <link> in portal_base.html
   ============================================================= */

/* ── Auth Pages (Login / Register / Password Reset) ─────────── */

.auth-page-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
}

.auth-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.auth-card--wide {
    max-width: 600px;
}

.auth-card-header {
    background: linear-gradient(135deg, var(--primary-color, #2D9CDB) 0%, #1a7bb9 100%);
    color: #fff;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.auth-logo {
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    opacity: 0.88;
    margin: 0;
}

.auth-card-body {
    padding: 2rem;
}

.auth-card-footer {
    padding: 1.25rem 2rem;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #eee;
}

/* ── Portal Shell Layout ─────────────────────────────────────── */

.portal-shell {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

/* Sidebar */
.portal-sidebar {
    width: 250px;
    min-height: 100vh;
    background: #fff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.portal-brand {
    padding: 1.5rem 1.25rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-color, #2D9CDB);
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.portal-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 0.6rem;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.portal-nav-link:hover,
.portal-nav-link.active {
    background: var(--primary-color, #2D9CDB);
    color: #fff;
    text-decoration: none;
}

.portal-nav-link i {
    width: 18px;
    text-align: center;
}

.portal-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.portal-logout-btn {
    color: #ef4444;
}

.portal-logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Main area */
.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top bar */
.portal-topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.portal-topbar-greeting {
    font-size: 0.95rem;
}

/* Content area */
.portal-content {
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ── Portal Components ────────────────────────────────────────── */

.portal-page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a2e;
}

.portal-welcome-banner {
    background: linear-gradient(135deg, var(--primary-color, #2D9CDB) 0%, #1a7bb9 100%);
    color: #fff;
    border-radius: 1rem;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Stat cards */
.portal-stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #e0f2fe;
    transition: transform 0.2s;
    border-left: 5px solid #2D9CDB;
}

.portal-stat-card:hover {
    transform: translateY(-3px);
}

.portal-card-blue {
    border-left-color: #2D9CDB;
}

.portal-card-indigo {
    border-left-color: #6366f1;
}

.portal-card-cyan {
    border-left-color: #06b6d4;
}

.portal-card-teal {
    border-left-color: #14b8a6;
}

.portal-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.portal-stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sections */
.portal-section {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.portal-section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

/* Detail cards */
.portal-detail-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    padding: 1.5rem;
}

.portal-detail-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

/* Definition List in cards */
.portal-dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    margin: 0;
}

.portal-dl dt {
    font-weight: 600;
    color: #666;
}

.portal-dl dd {
    margin: 0;
    color: #1a1a2e;
}

/* Table */
.portal-table thead {
    background: #f1f5f9;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

/* Badges */
.portal-badge {
    display: inline-block;
    padding: 0.25em 0.65em;
    border-radius: 0.4em;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.portal-badge--pending {
    background: #e0f2fe;
    color: #0369a1;
}

.portal-badge--booked {
    background: #dcfce7;
    color: #15803d;
}

.portal-badge--completed {
    background: #eff6ff;
    color: #1d4ed8;
}

.portal-badge--cancelled {
    background: #fef2f2;
    color: #b91c1c;
}

.portal-badge--paid {
    background: #ecfdf5;
    color: #047857;
}

.portal-badge--unpaid {
    background: #fffbeb;
    color: #b45309;
}

.portal-badge--failed {
    background: #fff1f2;
    color: #be123c;
}

.portal-badge--unread {
    background: #ede9fe;
    color: #6d28d9;
}

.portal-badge--read {
    background: #f3f4f6;
    color: #374151;
}

.portal-badge--replied {
    background: #ecfdf5;
    color: #047857;
}

/* Quick action cards */
.portal-quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: #1a1a2e;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 130px;
}

.portal-quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #1a1a2e;
    text-decoration: none;
}

/* Filter Tabs */
.portal-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.portal-filter-tab {
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    border: 1px solid #ddd;
    text-decoration: none;
    font-size: 0.85rem;
    color: #555;
    background: #fff;
    transition: all 0.2s;
}

.portal-filter-tab:hover,
.portal-filter-tab.active {
    background: var(--primary-color, #2D9CDB);
    border-color: var(--primary-color, #2D9CDB);
    color: #fff;
    text-decoration: none;
}

/* Empty State */
.portal-empty-state {
    padding: 3rem;
    text-align: center;
}

/* Profile Avatar */
.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #2D9CDB), #1a7bb9);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Messages */
.portal-messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 480px;
    overflow-y: auto;
}

.portal-message-item {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid #dee2e6;
}

.portal-message--unread {
    border-left-color: var(--primary-color, #2D9CDB);
    background: #f0f7ff;
}

.portal-message-body {
    font-size: 0.9rem;
    color: #555;
    white-space: pre-line;
}

/* ── Responsive Sidebar ─────────────────────────────────────── */

@media (max-width: 991.98px) {
    .portal-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .portal-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
}