/* ========================
   USER AUTH & PROFILE CSS
======================== */

/* --- Login/Register Split Page --- */
.auth-page {
    display: flex;
    min-height: 100vh;
}

.auth-brand-panel {
    width: 45%;
    background: var(--text-primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.auth-logo img {
    height: 50px;
    filter: brightness(0) invert(1);
    mix-blend-mode: normal;
}

.auth-brand-content {
    margin: auto 0;
}

.auth-brand-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-brand-content h2 span {
    background: linear-gradient(135deg, #f7c59f, #e8a87c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand-content p {
    font-size: 1.1rem;
    opacity: 0.7;
}

.auth-brand-footer {
    font-size: 0.85rem;
    opacity: 0.4;
}

/* --- Form Panel --- */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-main);
}

.auth-form-container {
    width: 100%;
    max-width: 480px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0 1rem;
    background: var(--white);
    transition: border-color 0.3s ease;
}

.input-wrap:focus-within {
    border-color: var(--text-primary);
}

.input-wrap.disabled {
    background: #f5f5f5;
    opacity: 0.7;
}

.input-wrap i {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-right: 0.8rem;
    flex-shrink: 0;
}

.input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.9rem 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: transparent;
    color: var(--text-primary);
}

.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.5rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: var(--text-primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-alert.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-alert.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ========================
   PROFILE DASHBOARD
======================== */
.profile-page {
    padding: 2rem 0 5rem;
    background: #f8f8f8;
    min-height: 80vh;
}

.profile-welcome {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-heading);
    flex-shrink: 0;
}

.welcome-info h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
}

.welcome-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.logout-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
}

/* Profile Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 12px;
    padding: 0.5rem;
    height: fit-content;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #f5f5f5;
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--text-primary);
    color: var(--white);
}

.sidebar-link.logout {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 8px 8px;
    color: #dc2626;
}

.sidebar-link i {
    font-size: 1.3rem;
}

/* Content Area */
.profile-content {
    min-width: 0;
}

.content-section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

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

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Order Cards */
.order-card {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fafafa;
    border-bottom: 1px solid var(--border-light);
}

.order-id {
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 1rem;
}

.order-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-status {
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-processing { background: #fef9c3; color: #a16207; }
.status-shipped { background: #dbeafe; color: #1d4ed8; }
.status-delivered { background: #dcfce7; color: #15803d; }
.status-cancelled { background: #fee2e2; color: #dc2626; }

.order-body {
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.order-detail .label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.order-detail .value {
    font-weight: 500;
    font-size: 0.95rem;
}

.order-detail .value a {
    color: #2563eb;
    font-weight: 600;
}

/* Profile Form */
.profile-form {
    max-width: 600px;
}

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 900px) {
    .auth-page {
        flex-direction: column;
    }
    .auth-brand-panel {
        width: 100%;
        padding: 2rem;
        min-height: auto;
    }
    .auth-brand-content h2 {
        font-size: 2rem;
    }
    .auth-form-panel {
        padding: 2rem 1.5rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .profile-layout {
        grid-template-columns: 1fr;
    }
    .profile-sidebar {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
    }
    .sidebar-link {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.8rem 1rem;
    }
    .sidebar-link.logout {
        margin-top: 0;
        border-top: none;
    }
    .profile-welcome {
        flex-wrap: wrap;
    }
    .logout-btn {
        margin-left: 0;
    }
    .order-body {
        grid-template-columns: 1fr;
    }
}
