/**
 * Firebase OTP Login Frontend Widget Styles
 * Highly customized, premium design using modern CSS best practices.
 */

/* Container and Card */
.firebase-otp-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 15px;
    width: 100%;
    box-sizing: border-box;
}

.firebase-otp-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 40px 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.firebase-otp-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Typography */
.firebase-otp-title {
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    text-align: center;
    letter-spacing: -0.5px;
}

.firebase-otp-subtitle {
    font-family: inherit;
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px 0;
    text-align: center;
    line-height: 1.5;
}

/* Input Fields and Labels */
.firebase-otp-input-group {
    margin-bottom: 24px;
    text-align: left;
    box-sizing: border-box;
}

.firebase-otp-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.firebase-otp-phone-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    overflow: hidden;
}

.firebase-otp-phone-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.firebase-otp-country-code {
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    background: #e2e8f0;
    border-right: 1.5px solid #cbd5e1;
    user-select: none;
}

#firebase-otp-phone,
#firebase-otp-code {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    color: #0f172a;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;
    font-family: monospace;
    letter-spacing: 0.5px;
}

#firebase-otp-phone::placeholder {
    color: #94a3b8;
    font-family: inherit;
    letter-spacing: normal;
}

#firebase-otp-code {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
    padding-left: 22px; /* Centers the text properly with letter spacing */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#firebase-otp-code:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.firebase-otp-help-text {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.firebase-otp-info-text {
    font-size: 14px;
    color: #475569;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.5;
}

#firebase-otp-edit-phone {
    display: inline-block;
    margin-left: 6px;
    cursor: pointer;
    color: #2563eb;
    font-size: 16px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

#firebase-otp-edit-phone:hover {
    transform: scale(1.2);
}

/* Button & Spinner */
.firebase-otp-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -2px rgba(37, 99, 235, 0.1);
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

.firebase-otp-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -4px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.firebase-otp-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px -1px rgba(37, 99, 235, 0.2);
}

.firebase-otp-btn:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ReCaptcha Styling */
#firebase-recaptcha-container {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

/* Alerts */
.firebase-otp-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid transparent;
}

.firebase-otp-alert.success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.firebase-otp-alert.error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Resend Countdown Link */
.firebase-otp-resend-wrapper {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

#firebase-otp-resend-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

#firebase-otp-resend-link:hover {
    text-decoration: underline;
}

#firebase-otp-resend-countdown {
    font-weight: 500;
}

/* Utility classes */
.hide {
    display: none !important;
}

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

/* Error widget loading fallback */
.firebase-otp-error {
    background-color: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 15px 0;
    text-align: center;
}

.firebase-otp-success-msg {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 15px 0;
    text-align: center;
}
.firebase-otp-success-msg a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.firebase-otp-success-msg a:hover {
    text-decoration: underline;
}
