/* ============================================
   Auth & Account Page Styles
   ============================================ */

/* Auth Page Layout */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
    background: var(--light-color);
    transition: padding-top 0.3s ease;
}

body.scrolled .auth-page {
    padding-top: 80px;
}

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

.auth-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 32px;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .form-group {
    margin-bottom: 0;
}

.auth-form label {
    display: block;
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="tel"],
.auth-form input[type="password"],
.auth-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus,
.auth-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.input-hint {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

.eye-icon {
    font-size: 1.2rem;
}

/* Form Options (checkbox row) */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.forgot-password-link {
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    padding: 0 16px;
    color: #888;
    font-size: 0.85rem;
}

/* Auth Switch Link */
.auth-switch {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

.auth-switch a {
    color: var(--secondary-color);
    font-weight: 500;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   Account Page Styles
   ============================================ */

.account-page {
    padding: 120px 20px 60px;
    background: var(--light-color);
    min-height: 100vh;
    transition: padding-top 0.3s ease;
}

body.scrolled .account-page {
    padding-top: 80px;
}

.account-container {
    max-width: 900px;
    margin: 0 auto;
}

.account-header {
    text-align: center;
    margin-bottom: 32px;
}

.account-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.account-header p {
    color: #666;
}

/* Account Tabs */
.account-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
    padding-bottom: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.tab-btn:hover {
    color: var(--dark-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Account Card */
.account-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.account-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    margin-bottom: 0;
}

/* Account Form */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
}

.account-form .form-group {
    margin-bottom: 0;
}

.account-form label {
    display: block;
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="tel"],
.account-form input[type="password"],
.account-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.account-form input:focus,
.account-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.order-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-id {
    font-weight: 600;
    color: var(--dark-color);
}

.order-date {
    font-size: 0.85rem;
    color: #888;
}

.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d4edda; color: #155724; }
.status-processing { background: #cce5ff; color: #004085; }
.status-shipped { background: #d1ecf1; color: #0c5460; }
.status-delivered { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.order-items {
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-bottom: 12px;
}

.order-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.item-name {
    font-weight: 500;
    color: var(--dark-color);
}

.item-details {
    font-size: 0.85rem;
    color: #666;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.order-total {
    font-weight: 600;
    color: var(--dark-color);
}

/* Addresses List */
.addresses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.address-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    position: relative;
}

.address-card.default {
    border-color: var(--primary-color);
    background: rgba(245, 166, 35, 0.03);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.address-label {
    font-weight: 600;
    color: var(--dark-color);
}

.default-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.address-text {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-line;
    margin-bottom: 12px;
}

.address-actions {
    display: flex;
    gap: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link.text-danger {
    color: #dc3545;
}

/* Address Form */
.address-form-container {
    border-top: 1px solid #eee;
    margin-top: 24px;
    padding-top: 24px;
}

.address-form-container h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark-color);
}

/* Empty States */
.empty-state,
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--dark-color);
}

.empty-state p {
    margin-bottom: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Logout Card */
.logout-card {
    text-align: center;
}

.logout-card h2 {
    margin-bottom: 8px;
}

.logout-card p {
    color: #666;
    margin-bottom: 16px;
}

/* ============================================
   Account Dropdown (Header)
   ============================================ */

.account-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.account-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    color: var(--dark-color);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #555;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

/* Account Icon States */
.account-icon {
    font-size: 1.2rem;
}

.account-logged-in {
    color: var(--primary-color);
}

.nav-icon-account {
    position: relative;
}

/* ============================================
   Button Styles
   ============================================ */

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .auth-page {
        padding: 100px 16px 40px;
    }

    body.scrolled .auth-page {
        padding-top: 64px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-card h1 {
        font-size: 1.6rem;
    }

    .account-page {
        padding: 100px 16px 40px;
    }

    body.scrolled .account-page {
        padding-top: 64px;
    }

    .account-tabs {
        gap: 4px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .account-card {
        padding: 20px 16px;
    }

    .order-header {
        flex-direction: column;
        gap: 8px;
    }

    .order-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .addresses-list {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}
