/**
 * Airbnb-Style Authentication Modals
 * Login and Registration modals with purple brand integration
 */

/* (removed experimental twofa overlay styles) */

/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */

.auth-modal-airbnb .modal-dialog {
    max-width: 568px;
    margin: 1.75rem auto;
}

@media (min-width: 576px) {
    .auth-modal-airbnb .modal-dialog {
        margin: 3rem auto;
    }
}

.auth-modal-airbnb .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.auth-modal-airbnb .modal-header {
    padding: 24px 24px 0;
    border: none;
    position: relative;
}

.auth-modal-airbnb .modal-header .close {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px;
    margin: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    opacity: 1;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.auth-modal-airbnb .modal-header .close:hover {
    background: #f7f7f7;
    border-color: #d0d0d0;
    transform: scale(1.05);
}

.auth-modal-airbnb .modal-header .close span {
    font-size: 20px;
    font-weight: 300;
    color: #222;
    line-height: 1;
}

.auth-modal-airbnb .modal-body {
    padding: 32px 24px 40px;
}

/* ============================================
   MODAL HEADER & BRANDING
   ============================================ */

.auth-modal-header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 8px;
}

.auth-modal-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.auth-modal-logo i {
    font-size: 24px;
    color: white;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.auth-modal-subtitle {
    font-size: 15px;
    color: #717171;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   FORM GROUPS & INPUTS
   ============================================ */

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group:last-of-type {
    margin-bottom: 24px;
}

.auth-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.auth-form-input {
    width: 100%;
    height: 56px;
    padding: 16px;
    font-size: 16px;
    color: #222;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: none;
    -webkit-appearance: none;
}

.auth-form-input:hover {
    border-color: #222;
}

.auth-form-input:focus {
    outline: none;
    border-color: #222;
    border-width: 2px;
    padding: 15px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.auth-form-input.error {
    border-color: #e53e3e;
}

.auth-form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Select Dropdown Airbnb Style */
.auth-form-select {
    width: 100%;
    height: 56px;
    padding: 16px;
    font-size: 16px;
    color: #222;
    background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    border: 1px solid #b0b0b0;
    border-radius: 12px;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.auth-form-select:hover {
    border-color: #222;
}

.auth-form-select:focus {
    outline: none;
    border-color: #222;
    border-width: 2px;
    padding: 15px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Error Messages */
.auth-error-message {
    display: block;
    font-size: 13px;
    color: #e53e3e;
    margin-top: 6px;
    font-weight: 500;
}

/* Success Messages */
.auth-success-message {
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    color: #166534;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-success-message i {
    color: #22c55e;
}

/* Alert Messages */
.auth-alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.auth-alert.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-alert.alert-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* ============================================
   BUTTONS
   ============================================ */

.auth-btn {
    width: 100%;
    height: 56px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.auth-btn-primary:disabled {
    background: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-secondary {
    background: #ffffff;
    color: #222;
    border: 1px solid #222;
}

.auth-btn-secondary:hover {
    background: #f7f7f7;
    transform: translateY(-1px);
}

.auth-btn-link {
    background: transparent;
    color: #667eea;
    height: auto;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
}

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

/* ============================================
   CHECKBOX & TERMS
   ============================================ */

.auth-checkbox-group {
    margin: 20px 0 24px;
}

.auth-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.auth-checkbox {
    width: 20px;
    height: 20px;
    border: 1.5px solid #b0b0b0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
    appearance: none;
    -webkit-appearance: none;
}

.auth-checkbox:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='20 6 9 17 4 12'%3e%3c/polyline%3e%3c/svg%3e");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-checkbox:hover {
    border-color: #667eea;
}

.auth-checkbox-label {
    font-size: 14px;
    color: #717171;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

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

/* ============================================
   FOOTER LINKS
   ============================================ */

.auth-modal-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #ebebeb;
    margin-top: 32px;
}

.auth-footer-text {
    font-size: 14px;
    color: #717171;
    margin: 0 0 12px;
}

.auth-footer-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-footer-link {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #f7f7f7;
}

.auth-footer-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
}

.auth-link-simple {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.auth-link-simple:hover {
    text-decoration: underline;
    color: #5568d3;
}

/* ============================================
   DIVIDER
   ============================================ */

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

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ebebeb;
}

.auth-divider-text {
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: #717171;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   SOCIAL LOGIN BUTTONS (Optional)
   ============================================ */

.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-btn-social {
    height: 56px;
    background: #ffffff;
    color: #222;
    border: 1px solid #222;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn-social:hover {
    background: #f7f7f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-btn-social i {
    font-size: 20px;
}

/* ============================================
   MULTI-STEP WIZARD PROGRESS
   ============================================ */

.auth-wizard-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 24px;
}

.auth-wizard-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ebebeb;
    color: #b0b0b0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-wizard-step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.auth-wizard-step.completed {
    background: #667eea;
    color: #ffffff;
}

.auth-wizard-line {
    flex: 1;
    max-width: 40px;
    height: 2px;
    background: #ebebeb;
    transition: all 0.3s ease;
}

.auth-wizard-line.completed {
    background: #667eea;
}

/* ============================================
   FORGOT PASSWORD LINK
   ============================================ */

.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: 14px;
    margin-top: -12px;
    margin-bottom: 20px;
}

/* ============================================
   OTP INPUT SPECIAL STYLE
   ============================================ */

.auth-otp-info {
    text-align: center;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 12px;
    margin-bottom: 24px;
}

.auth-otp-info p {
    margin: 0;
    font-size: 14px;
    color: #717171;
    line-height: 1.6;
}

.auth-otp-info strong {
    color: #222;
    font-weight: 600;
}

.auth-resend-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #717171;
}

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

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

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 575px) {
    .auth-modal-airbnb .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .auth-modal-airbnb .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }

    .auth-modal-header {
        margin-bottom: 24px;
    }

    .auth-modal-title {
        font-size: 20px;
    }

    .auth-form-input,
    .auth-form-select,
    .auth-btn {
        height: 52px;
    }

    .auth-footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .auth-footer-link {
        width: 100%;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.auth-modal-airbnb .modal-content {
    animation: slideInUp 0.3s ease-out;
}

/* ============================================
   LOADING STATE
   ============================================ */

.auth-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.auth-btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    color: #ffffff;
}

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

/* ============================================
   HIDE OLD STYLES
   ============================================ */

/* Override old modal classes when inside Airbnb auth modal */
.auth-modal-airbnb .account-content,
.auth-modal-airbnb .account-box,
.auth-modal-airbnb .login-right {
    all: unset;
    display: block;
    width: 100%;
}

.auth-modal-airbnb .login-header {
    all: unset;
    display: block;
}

/* ============================================
   ENSURE BOOTSTRAP COMPATIBILITY
   ============================================ */

/* Make sure Bootstrap custom-control checkboxes work */
.custom-control-input:checked ~ .auth-checkbox-label::before,
.auth-checkbox.custom-control-input:checked ~ .custom-control-label::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
}

/* ============================================
   BUTTON COMPATIBILITY WITH EXISTING JS
   ============================================ */

/* Ensure icon stays visible when JS changes button text */
.auth-btn i {
    margin-right: 8px;
}

.auth-btn .btn-text {
    display: inline;
}

/* Button disabled state */
.auth-btn:disabled,
.auth-btn[disabled] {
    background: #e0e0e0 !important;
    color: #a0a0a0 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    box-shadow: none !important;
    transform: none !important;
}

.auth-btn:disabled:hover,
.auth-btn[disabled]:hover {
    background: #e0e0e0 !important;
    transform: none !important;
}

/* Loading state */
.auth-btn.loading {
    position: relative;
    color: transparent !important;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==================================================
   BOOTSTRAP VALIDATOR COMPATIBILITY
   ================================================== */

/* Ensure BootstrapValidator can style our custom inputs */
.auth-form-input.form-control,
.auth-form-select.form-control {
    /* Keep Airbnb styling while allowing validator to work */
}

/* Validation error state */
.form-group.has-error .auth-form-input,
.form-group.has-error .auth-form-select {
    border-color: #e53e3e !important;
}

.form-group.has-error .auth-form-input:focus,
.form-group.has-error .auth-form-select:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

/* Validation success state */
.form-group.has-success .auth-form-input,
.form-group.has-success .auth-form-select {
    border-color: #22c55e !important;
}

.form-group.has-success .auth-form-input:focus,
.form-group.has-success .auth-form-select:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

/* Help block for validation messages */
.form-group .help-block {
    font-size: 13px;
    color: #e53e3e;
    margin-top: 6px;
    display: block;
}

.form-group.has-success .help-block {
    color: #22c55e;
}

/* Form control feedback icons */
.form-control-feedback {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

.form-group.has-error .form-control-feedback {
    color: #e53e3e;
}

.form-group.has-success .form-control-feedback {
    color: #22c55e;
}
