﻿/* ===== AUTH MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: var(--spacing-sm);
}

.modal-overlay.open {
    display: flex;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-container::-webkit-scrollbar {
    display: none;
}

.modal-content {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ===== LOGGED IN STATE ===== */
.btn-login.logged-in {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: none;
    font-weight: 600;
}

.btn-login.logged-in:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    transform: translateY(-1px);
}

.user-logged-in .btn-cta {
    background: linear-gradient(135deg, #10b981, #059669);
}

.user-logged-in .btn-cta:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.modal-close-btn:hover {
    color: var(--color-text-main);
    background: rgba(var(--color-primary-rgb), 0.08);
    transform: rotate(90deg);
}

/* Auth Background Effect */
.auth-bg-effect {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.12) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

body.dark-mode .auth-bg-effect {
    opacity: 0.8;
}

/* Auth Card */
.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

body.dark-mode .auth-card {
    background: rgba(19, 19, 22, 0.85);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 48px;
    width: auto;
    margin: 0 auto var(--spacing-sm);
}

.auth-title {
    color: var(--color-text-main);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    background: var(--color-bg-body);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    color: var(--color-text-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
    font-family: var(--font-body);
}

body.dark-mode .form-input {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

body.dark-mode .form-input:focus {
    background: rgba(0, 0, 0, 0.5);
}

.form-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.forgot-password {
    display: block;
    text-align: right;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--color-primary);
}

/* Auth Primary Button */
.btn-auth-primary {
    width: 100%;
    background: var(--color-primary);
    color: #000;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: none;
    font-family: var(--font-body);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-auth-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

body.dark-mode .auth-divider::before,
body.dark-mode .auth-divider::after {
    background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    padding: 0 1rem;
    text-transform: uppercase;
}

/* SSO Buttons */
.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 0.7rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
    font-family: var(--font-body);
}

body.dark-mode .btn-sso {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.btn-sso:hover {
    background: rgba(var(--color-primary-rgb), 0.04);
    border-color: rgba(var(--color-primary-rgb), 0.2);
}

body.dark-mode .btn-sso:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.sso-icon {
    width: 20px;
    height: 20px;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-footer a:hover {
    opacity: 0.8;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    opacity: 0.6;
}

.lock-icon {
    width: 12px;
    height: 12px;
}


/* ===== DEMO OPTION BUTTONS ===== */
.demo-options {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.demo-option-btn {
    flex: 1;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    background: transparent;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.demo-option-btn:hover {
    border-color: rgba(var(--color-primary-rgb), 0.4);
    background: rgba(var(--color-primary-rgb), 0.04);
}

.demo-option-btn.selected {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
    font-weight: 600;
}

/* Password Toggle Styles */
.password-wrapper {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.eye-icon {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

.eye-icon.hidden {
    display: none;
}

/* Adjust password input padding to accommodate toggle button */
.password-wrapper .form-input {
    padding-right: 3rem;
}

/* ===== PHONE INPUT ===== */
.phone-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.phone-prefix {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 2;
    pointer-events: none;
}

.phone-input {
    padding-left: 52px !important;
}

/* Fix light mode form label contrast */
.form-label {
    display: block;
    color: var(--color-text-main);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}
