/**
 * Email OTP Verification Styles - Baudouin India
 */

/* Disabled Submit Button */
.wpcf7 form button[type="submit"]:disabled,
.wpcf7 form input[type="submit"]:disabled,
.contact-form-wrapper button[type="submit"]:disabled,
#contact-form button[type="submit"]:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    filter: grayscale(80%) !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Email Input Group — Button shown below the field */
.email-otp-group {
    width: 100%;
}

.email-otp-group p {
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    width: 100%;
}

.email-otp-group .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.email-otp-group input[type="email"].is-verified {
    background-color: #f6fdf8 !important;
    border-left: 3px solid #16a34a !important;
    color: #1b4d2e !important;
    text-overflow: ellipsis;
}

.btn-send-otp {
    display: inline-block;
    width: auto;
    margin-top: 6px;
    background-color: #001e61;
    color: #ffffff !important;
    border: none;
    outline: none;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    text-align: left;
    line-height: normal;
    box-sizing: border-box;
}

.btn-send-otp:hover:not(:disabled) {
    background-color: #093796;
}

.btn-send-otp:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.verified-badge {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    background-color: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
}

/* OTP Verification Row / Box */
.otp-verification-wrapper {
    margin-top: 10px;
    background: #ffffff;
    padding: 14px 16px;
    border-left: 3px solid #001e61;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: none;
    animation: fadeInOtp 0.25s ease-out;
    max-width: 320px;
}

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

.otp-box-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.otp-box-inner p {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Desktop: hide verify button in its original position (will be moved to meta-row via JS) */
@media (min-width: 769px) {
    .otp-box-inner .btn-verify-otp {
        display: none !important;
    }
    .otp-code-input {
        width: 228px;
        flex: 0 0 228px;
    }
}

.otp-code-input {
    flex: 1;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 3px !important;
    font-size: 16px !important;
    letter-spacing: 3px;
    font-weight: 600;
    text-align: center;
    background: #f9fafb !important;
    color: #000000 !important;
    outline: none;
    box-sizing: border-box;
}

.otp-code-input:focus {
    border-color: #001e61 !important;
    background: #ffffff !important;
}

.btn-verify-otp {
    background-color: #001e61;
    color: #ffffff !important;
    border: none;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-verify-otp:hover:not(:disabled) {
    background-color: #093796;
}

.btn-verify-otp:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.otp-meta-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    min-height: 28px; /* prevents height shift during timer→resend toggle */
}

/* Prevent <br> from causing layout shift */
.otp-meta-row p {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    min-height: 28px;
}

.otp-meta-row p br {
    display: none !important;
}

/* Desktop: verify button inside meta-row (moved via JS) */
@media (min-width: 769px) {
    .otp-meta-row .btn-verify-otp {
        display: inline-flex !important;
        align-items: center;
        padding: 7px 16px;
        font-size: 12px;
        font-weight: 700;
    }
}

.otp-timer-info {
    color: #6b7280;
    font-size: 12px;
    min-width: 100px;   /* prevents layout shift when text changes */
    display: inline-block;
}

.otp-timer-info strong {
    color: #001e61;
    font-weight: 600;
}

.btn-resend-link {
    background: none;
    border: none;
    color: #001e61;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    display: none;
    min-width: 100px;   /* same width as timer to prevent shift */
}

.btn-resend-link:hover {
    color: #093796;
}

/* Feedback Messages */
.otp-status-message {
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
    display: none;
}

.otp-status-message.error {
    color: #d8000c;
    display: block;
}

.otp-status-message.success {
    color: #16a34a;
    display: block;
}

.otp-status-message.info {
    color: #0b3c6d;
    display: block;
}

/* Helper note below submit button */
.submit-otp-note {
    font-size: 12px;
    color: #718096;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.submit-otp-note.hidden {
    display: none;
}

@media (max-width: 768px) {
    .btn-send-otp {
        padding: 6px 14px;
        font-size: 11px;
    }
    .otp-verification-wrapper {
        padding: 8px 10px;
        margin-top: 6px;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .otp-box-inner {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .otp-box-inner,
    .otp-box-inner p {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .otp-code-input {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: 0 !important;
        padding: 6px 6px !important;
        font-size: 12px !important;
        letter-spacing: 1px !important;
        height: 34px !important;
        box-sizing: border-box !important;
    }
    .btn-verify-otp {
        flex: 0 0 auto !important;
        width: auto !important;
        padding: 0 10px !important;
        height: 34px !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }
    .otp-meta-row {
        margin-top: 5px;
        font-size: 11px;
    }
    .otp-timer-info {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .otp-verification-wrapper {
        padding: 6px 8px;
    }
    .otp-box-inner,
    .otp-box-inner p {
        gap: 4px !important;
    }
    .otp-code-input {
        padding: 5px 4px !important;
        font-size: 11px !important;
        letter-spacing: 0.5px !important;
        height: 32px !important;
    }
    .btn-verify-otp {
        padding: 0 8px !important;
        height: 32px !important;
        font-size: 10px !important;
        letter-spacing: 0.3px !important;
    }
    .otp-meta-row {
        font-size: 10px;
    }
    .otp-timer-info {
        font-size: 10px;
    }
}
