/* ==========================================================================
   IPF — Auth pages & Dashboard styles
   ========================================================================== */

/* ---------- Auth pages (login & register) ---------- */
.auth-body {
    background: var(--color-cream);
    min-height: 100vh;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Left branding panel */
.auth-brand-panel {
    background: linear-gradient(160deg, var(--color-forest-deep) 0%, var(--color-forest) 50%, var(--color-forest-light) 100%);
    color: var(--color-white);
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.auth-brand .brand-mark {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.auth-brand-name {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-white);
    line-height: 1.2;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
}

.auth-brand-content h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.auth-brand-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 420px;
}

.auth-brand-content blockquote {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--color-gold);
    border-left: 3px solid var(--color-gold);
    padding-left: 1.25rem;
    max-width: 400px;
}

/* Right form panel */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--color-white);
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
    min-width: 0;
}

.auth-form-container h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--color-forest);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.auth-subtitle {
    color: var(--color-muted);
    font-size: 15px;
    margin-bottom: 2rem;
}

.auth-errors {
    background: rgba(220, 80, 70, 0.08);
    border: 1px solid rgba(220, 80, 70, 0.25);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.auth-errors p {
    color: #c0392b;
    font-size: 14px;
    font-weight: 500;
}

.auth-errors ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.auth-errors li {
    color: #c0392b;
    font-size: 13px;
    margin-bottom: 0.25rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
    letter-spacing: 0.3px;
}

.form-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--color-ink);
    background: var(--color-cream);
    transition: border-color var(--transition), background var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-field input:focus {
    outline: none;
    border-color: var(--color-forest);
    background: var(--color-white);
}

.form-field input::placeholder {
    color: #aaa;
}

.btn-auth {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--color-forest);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-auth:hover {
    background: var(--color-forest-deep);
    transform: translateY(-1px);
}

.auth-footer-text {
    margin-top: 1.25rem;
    font-size: 14px;
    color: var(--color-muted);
    text-align: center;
}

.auth-footer-text a {
    color: var(--color-forest);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}

.auth-footer-text a:hover {
    color: var(--color-gold-deep);
}

/* ---------- Dashboard ---------- */
.dashboard-body {
    background: var(--color-cream);
    min-height: 100vh;
}

.dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--color-forest-deep);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    z-index: 100;
    overflow-y: auto;
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 1.5rem 1.5rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 165, 116, 0.15);
    margin-bottom: 1rem;
}

.dash-brand .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.dash-brand-name {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-white);
}

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

.dash-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.dash-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
}

.dash-nav-link.active {
    background: rgba(212, 165, 116, 0.15);
    color: var(--color-gold);
}

.dash-sidebar-footer {
    padding: 1rem 1rem 0;
    border-top: 1px solid rgba(212, 165, 116, 0.15);
    margin-top: 1rem;
}

.dash-user-mini {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.dash-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-gold);
    color: var(--color-forest-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.dash-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-white);
    line-height: 1.2;
}

.dash-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.dash-logout-btn {
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
}

.dash-logout-btn:hover {
    background: rgba(220, 80, 70, 0.2);
    border-color: rgba(220, 80, 70, 0.4);
    color: var(--color-white);
}

/* Dashboard main */
.dash-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dash-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.dash-topbar h1 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--color-forest);
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.dash-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-forest);
    cursor: pointer;
    padding: 0.25rem;
}

.dash-date {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
}

.dash-content {
    padding: 2rem;
    flex: 1;
}

/* Welcome banner */
.dash-welcome {
    background: linear-gradient(135deg, var(--color-forest) 0%, var(--color-forest-light) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    color: var(--color-white);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.dash-welcome::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
}

.dash-welcome h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    position: relative;
}

.dash-welcome p {
    font-size: 15px;
    opacity: 0.9;
    position: relative;
}

/* Stats cards */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dash-stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition);
}

.dash-stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-green {
    background: rgba(45, 95, 63, 0.1);
    color: var(--color-forest);
}

.dash-stat-gold {
    background: rgba(212, 165, 116, 0.15);
    color: var(--color-gold-deep);
}

.dash-stat-blue {
    background: rgba(74, 123, 167, 0.12);
    color: var(--color-blue);
}

.dash-stat-purple {
    background: rgba(147, 112, 219, 0.12);
    color: #9370db;
}

.dash-stat-number {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-ink);
    line-height: 1;
}

.dash-stat-label {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 0.25rem;
}

/* Two-column grid */
.dash-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dash-panel {
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: 1.75rem;
}

.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.dash-panel-head h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-forest);
    font-weight: 600;
    margin: 0;
}

.dash-panel-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-gold-deep);
    background: rgba(212, 165, 116, 0.12);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

/* Pillar progress list */
.dash-pillars-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dash-pillar-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-pillar-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 13px;
    color: var(--color-ink);
    font-weight: 500;
}

.dash-pillar-tag {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--color-forest);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.dash-progress {
    height: 8px;
    background: var(--color-cream-deep);
    border-radius: 999px;
    overflow: hidden;
}

.dash-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-forest) 0%, var(--color-forest-light) 100%);
    border-radius: 999px;
    transition: width 0.8s ease;
}

/* Activity list */
.dash-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dash-activity-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.dash-activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.dash-activity-green {
    background: var(--color-forest);
}

.dash-activity-gold {
    background: var(--color-gold);
}

.dash-activity-blue {
    background: var(--color-blue);
}

.dash-activity-text {
    font-size: 14px;
    color: var(--color-ink);
    line-height: 1.5;
    margin: 0;
}

.dash-activity-time {
    font-size: 12px;
    color: var(--color-muted);
}

/* Quick actions */
.dash-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.dash-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.75rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-forest);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}

.dash-action-card:hover {
    border-color: var(--color-gold);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    color: var(--color-gold-deep);
}

.dash-action-card svg {
    color: var(--color-forest);
    transition: color var(--transition);
}

.dash-action-card:hover svg {
    color: var(--color-gold-deep);
}

/* ---------- Dashboard responsive ---------- */
@media (max-width: 1024px) {
    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .dash-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dash-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
        box-shadow: var(--shadow-lg);
    }

    .dash-sidebar.open {
        transform: translateX(0);
    }

    .dash-main {
        margin-left: 0;
    }

    .dash-menu-toggle {
        display: flex;
    }

    .dash-content {
        padding: 1.25rem;
    }

    .dash-welcome {
        padding: 1.5rem 1.5rem;
    }

    .dash-welcome h2 {
        font-size: 1.4rem;
    }

    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .dash-stat-card {
        padding: 1.25rem;
    }

    .dash-stat-number {
        font-size: 1.4rem;
    }

    .dash-panel {
        padding: 1.25rem;
    }

    .dash-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .dash-action-card {
        padding: 1.25rem 0.75rem;
        font-size: 13px;
    }
}

/* ---------- Auth responsive ---------- */
@media (max-width: 900px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: 2rem 1.25rem;
    }

    .auth-form-container {
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .auth-form-container h1 {
        font-size: 1.65rem;
    }

    .dash-stats {
        grid-template-columns: 1fr;
    }

    .dash-actions {
        grid-template-columns: 1fr;
    }
}