/* ==========================================
   Auth Modal Styles
   ========================================== */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

/* Custom scrollbar for auth modal */
.auth-modal-content::-webkit-scrollbar {
    width: 8px;
}

.auth-modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 16px 0;
}

.auth-modal-content::-webkit-scrollbar-thumb {
    background: rgba(44, 95, 45, 0.3);
    border-radius: 4px;
}

.auth-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(44, 95, 45, 0.5);
}

/* Firefox scrollbar */
.auth-modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(44, 95, 45, 0.3) transparent;
}

.auth-modal.active .auth-modal-content {
    transform: translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.auth-modal-close:hover {
    background: #e8e8e8;
    color: #333;
}

.auth-modal-body {
    padding: 32px 36px;
}

/* ==========================================
   Auth Views
   ========================================== */

.auth-view h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 28px 0;
    font-size: 15px;
    color: #666;
    text-align: center;
}

.auth-icon {
    text-align: center;
    margin-bottom: 16px;
}

.auth-icon i {
    font-size: 40px;
    color: #2C5F2D;
}

/* ==========================================
   Form Styles
   ========================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #2C5F2D;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

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

.form-hint {
    font-size: 12px;
    color: #888;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.form-row-2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #2C5F2D;
    cursor: pointer;
}

.checkbox-label a {
    color: #2C5F2D;
    text-decoration: underline;
}

/* ==========================================
   Error & Success Messages
   ========================================== */

.form-error {
    color: #d32f2f;
    font-size: 14px;
    min-height: 20px;
    text-align: center;
}

.form-success {
    color: #2C5F2D;
    font-size: 14px;
    min-height: 20px;
    text-align: center;
    background: rgba(44, 95, 45, 0.1);
    padding: 10px;
    border-radius: 8px;
}

/* ==========================================
   Buttons
   ========================================== */

.auth-submit-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #2C5F2D 0%, #1e4620 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a7a3c 0%, #2C5F2D 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-submit-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.auth-submit-btn-secondary:hover:not(:disabled) {
    background: #e8e8e8;
    box-shadow: none;
    transform: none;
}

.google-login-btn {
    width: 100%;
    padding: 12px 24px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.google-login-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
}

.google-login-btn svg {
    flex-shrink: 0;
}

/* ==========================================
   Divider & Links
   ========================================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

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

.auth-divider span {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
}

.auth-link {
    color: #2C5F2D;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #1e4620;
    text-decoration: underline;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 16px;
}

/* ==========================================
   Guest Checkout
   ========================================== */

.guest-checkout-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2C5F2D 0%, #3d7a3e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.3);
}

.guest-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.4);
}

.guest-checkout-btn i {
    font-size: 18px;
}

.guest-checkout-hint {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-top: 8px;
    margin-bottom: 20px;
}

.guest-divider {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
}

.guest-submit-btn {
    background: linear-gradient(135deg, #2C5F2D 0%, #3d7a3e 100%);
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.3);
}

.guest-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.4);
}

.guest-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0;
    padding: 16px;
    background: #f8faf8;
    border-radius: 10px;
    border: 1px solid #e8efe8;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
}

.benefit-item i {
    color: #2C5F2D;
    font-size: 14px;
}

.auth-guest-checkout .auth-icon {
    margin-bottom: 12px;
}

.auth-guest-checkout .auth-icon i {
    color: #2C5F2D;
    font-size: 36px;
}

/* ==========================================
   Profile UI Elements
   ========================================== */

.profile-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    background: #f5f5f5;
}

.profile-icon:hover {
    background: #e8e8e8;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials {
    font-size: 14px;
    font-weight: 600;
    color: #2C5F2D;
}

/* Admin badge */
.admin-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 12px;
    line-height: 1;
    z-index: 1;
}

/* User button needs position relative for admin badge */
#userBtn {
    position: relative;
}

/* Admin panel link in dropdown */
.admin-panel-link {
    border-radius: 6px !important;
    margin-bottom: 8px !important;
}

.admin-panel-link:hover {
    opacity: 0.9;
    transform: translateX(2px);
}

/* Profile dropdown */
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.profile-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.profile-dropdown-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.profile-dropdown-email {
    font-size: 13px;
    color: #888;
}

.profile-dropdown-menu {
    padding: 8px 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #555;
    text-decoration: none;
    transition: background 0.2s ease;
}

.profile-dropdown-item:hover {
    background: #f8f8f8;
}

.profile-dropdown-item i {
    width: 20px;
    text-align: center;
    color: #888;
}

.profile-dropdown-item.logout {
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    padding-top: 12px;
    color: #d32f2f;
}

.profile-dropdown-item.logout i {
    color: #d32f2f;
}

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

@media (max-width: 480px) {
    .auth-modal-body {
        padding: 32px 24px;
    }
    
    .auth-view h2 {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================
   Toast Notifications (for auth feedback)
   ========================================== */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: #333;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #2C5F2D;
}

.toast.error {
    background: #d32f2f;
}

