/* ===================================
   AUTH MODAL - MODERN DESIGN
   Based on emlak_login_register_modal.html template
   =================================== */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

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

/* Modal Container */
.auth-modal-container {
    background: #242736;
    width: 90%;
    max-width: 420px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid #2d3142;
    position: relative;
}

.auth-modal-overlay.active .auth-modal-container {
    transform: scale(1) translateY(0);
}

/* Close Button */
.auth-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    color: white;
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.auth-close-btn .iconify {
    font-size: 20px;
}

/* Modal Header */
.auth-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 25px 25px;
    text-align: center;
    position: relative;
}

.auth-modal-logo {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-modal-logo .iconify {
    font-size: 26px;
    color: #667eea;
}

.auth-modal-title {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

/* Tab Switcher */
.auth-tab-switcher {
    display: flex;
    background: #1a1d29;
    margin: -10px 30px 0;
    border-radius: 10px;
    position: relative;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #2d3142;
}

.auth-tab-btn {
    flex: 1;
    padding: 11px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #7d8299;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab-btn.active {
    color: #fff;
}

.auth-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px 3px 0 0;
    transition: transform 0.3s ease;
}

.auth-tab-indicator.register {
    transform: translateX(100%);
}

/* Modal Body */
.auth-modal-body {
    padding: 25px;
}

/* Form Container */
.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Groups */
.auth-form-group {
    margin-bottom: 15px;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #7d8299;
    font-size: 20px;
    pointer-events: none;
}

.auth-form-input {
    width: 100%;
    padding: 13px 15px 13px 44px;
    border: 2px solid #2d3142;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #1a1d29;
    color: #e4e6eb;
    font-family: inherit;
}

.auth-form-input::placeholder {
    color: #7d8299;
}

.auth-form-input:focus {
    outline: none;
    border-color: #667eea;
    background: #1f2231;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: #667eea;
}

/* Password Toggle */
.auth-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #7d8299;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.2s ease;
}

.auth-password-toggle:hover {
    color: #667eea;
}

/* Form Options */
.auth-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.auth-checkbox-wrapper label {
    font-size: 13px;
    color: #a8afc7;
    cursor: pointer;
    user-select: none;
}

.auth-forgot-link {
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: #764ba2;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

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

/* Loading State */
.auth-submit-btn.loading {
    color: transparent;
}

.auth-submit-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Secondary Button */
.auth-btn-secondary {
    background: transparent;
    border: 2px solid #2d3142;
    color: #a8afc7;
}

.auth-btn-secondary:hover {
    background: #1a1d29;
    border-color: #667eea;
    color: #667eea;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #2d3142;
}

.auth-divider span {
    position: relative;
    padding: 0 15px;
    background: #242736;
    color: #7d8299;
    font-size: 13px;
}

/* Social Login */
.auth-social-login {
    display: flex;
    gap: 12px;
}

.auth-social-btn {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-social-btn:hover {
    transform: translateY(-2px);
}

/* Google Sign-In Button Override */
.auth-social-btn > div {
    width: 100% !important;
}

.auth-social-btn iframe {
    width: 100% !important;
    border-radius: 10px !important;
}

/* Terms Text */
.auth-terms-text {
    text-align: center;
    font-size: 12px;
    color: #7d8299;
    margin-top: 15px;
    line-height: 1.5;
}

.auth-terms-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-terms-text a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Auth Text (for forgot password) */
.auth-text {
    font-size: 14px;
    color: #a8afc7;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Inline Error Message */
.auth-error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 13px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
}

.auth-error-message .iconify {
    font-size: 18px;
    flex-shrink: 0;
}

/* Inline Success Message */
.auth-success-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 8px;
    color: #34d399;
    font-size: 13px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
}

.auth-success-message .iconify {
    font-size: 18px;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Full Page Success Message */
.auth-success-message-full {
    display: none;
    text-align: center;
    padding: 40px;
}

.auth-success-message-full.active {
    display: block;
}

.auth-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.auth-success-icon .iconify {
    color: white;
    font-size: 40px;
}

.auth-success-title {
    font-size: 20px;
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: 10px;
}

.auth-success-text {
    font-size: 14px;
    color: #a8afc7;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-container {
        width: 95%;
        margin: 20px;
    }

    .auth-modal-header {
        padding: 25px 20px 20px;
    }

    .auth-modal-body {
        padding: 20px;
    }

    .auth-social-login {
        flex-direction: column;
    }
}
