/* Autofie Auth Popup */

.autofie-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.autofie-modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    width: 100%;
    max-width: 440px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.autofie-close {
    position: absolute;
    top: 14px; right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

.autofie-close:hover { color: #000; }

.autofie-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #1a1a1a;
}

/* Social Buttons */
.autofie-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.autofie-google-btn,
.autofie-facebook-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.autofie-google-btn {
    background: #fff;
    border: 1.5px solid #ddd;
    color: #333;
}

.autofie-google-btn img {
    width: 20px;
    height: 20px;
}

.autofie-google-btn:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.autofie-facebook-btn {
    background: #1877f2;
    color: #fff;
}

.autofie-coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Override Nextend button styles inside popup */
.autofie-social .nsl-container {
    width: 100% !important;
}

.autofie-social .nsl-container-buttons {
    flex-direction: column !important;
    gap: 10px !important;
}

.autofie-social .nsl-button {
    width: 100% !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

/* Divider */
.autofie-divider {
    text-align: center;
    position: relative;
    margin: 16px 0;
    color: #999;
    font-size: 13px;
}

.autofie-divider::before,
.autofie-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: #e5e5e5;
}

.autofie-divider::before { left: 0; }
.autofie-divider::after { right: 0; }

/* Form Inputs */
.autofie-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.autofie-input:focus {
    border-color: #e67e22;
}

.autofie-row {
    display: flex;
    gap: 10px;
}

.autofie-row .autofie-input {
    flex: 1;
}

.autofie-password-wrap {
    position: relative;
}

.autofie-password-wrap .autofie-input {
    padding-right: 40px;
}

.autofie-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-60%);
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
}

/* Phone Row */
.autofie-phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.autofie-flag {
    background: #f5f5f5;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.autofie-phone-input {
    flex: 1;
    margin-bottom: 0 !important;
}

/* OTP Button */
.autofie-otp-btn {
    width: 100%;
    padding: 11px;
    background: #e67e22;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
}

.autofie-otp-btn:hover { background: #d35400; }
.autofie-otp-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* OTP Step */
.autofie-otp-note {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px;
}

.autofie-otp-input {
    letter-spacing: 6px;
    font-size: 20px;
    text-align: center;
    font-weight: 700;
}

.autofie-resend {
    font-size: 13px;
    color: #666;
    margin: 4px 0 12px;
    text-align: center;
}

.autofie-resend a { color: #e67e22; text-decoration: none; }

/* Dealer Box */
.autofie-dealer-box {
    background: #fff8f2;
    border: 1.5px solid #f0c090;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.autofie-dealer-box label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.autofie-dealer-note {
    font-size: 12px;
    color: #888;
    margin: 6px 0 0;
}

/* Terms */
.autofie-terms {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    margin-bottom: 14px;
    cursor: pointer;
}

.autofie-terms a { color: #e67e22; }

/* Submit Button */
.autofie-submit-btn {
    width: 100%;
    padding: 13px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background 0.2s;
}

.autofie-submit-btn:hover { background: #219a52; }
.autofie-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Switch Link */
.autofie-switch {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}

.autofie-switch a {
    color: #27ae60;
    font-weight: 600;
    text-decoration: none;
}

/* Message Box */
.autofie-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

.autofie-msg.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.autofie-msg.error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Mobile */
@media (max-width: 480px) {
    .autofie-modal {
        padding: 24px 18px;
    }
    .autofie-row {
        flex-direction: column;
        gap: 0;
    }
}