/**
 * WooCommerce Seamless OTP Login - Frontend Styles
 *
 * Stili ottimizzati per integrarsi perfettamente con:
 * - WooCommerce checkout nativo
 * - Tema Hello Elementor / Elementor
 * - CartFlows checkout
 *
 * @package WC_OTP_Login
 */

/* ==========================================================================
   OTP Checkout Wrapper - integrato nello stile WooCommerce
   ========================================================================== */

.wc-otp-checkout-wrapper {
    margin: 0 0 2em 0;
    padding: 1.5em;
    background: #fafafa;
    border: 1px solid #d5d8dc;
    border-radius: 4px;
}

.wc-otp-checkout-wrapper h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.wc-otp-checkout-description {
    color: #666;
    margin-bottom: 1.2em;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Separator "Oppure continua come ospite" */
.otp-checkout-separator {
    border-top: 1px solid #d5d8dc;
    margin: 1.5em 0 0.5em 0;
    text-align: center;
    position: relative;
}

.otp-checkout-separator span {
    background: #fafafa;
    padding: 0 0.8em;
    position: relative;
    top: -0.7em;
    color: #999;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   OTP Login Wrapper
   ========================================================================== */

.wc-otp-login-wrapper {
    margin: 1em 0;
    padding: 0;
}

/* Status Messages - stile WooCommerce */
.wc-otp-login-wrapper .otp-status {
    margin: 1em 0;
    padding: 0.8em 1em;
    border-radius: 4px;
    display: none;
    font-size: 0.9em;
    line-height: 1.4;
    border-left: 4px solid transparent;
}

.wc-otp-login-wrapper .otp-status.success {
    background: #f0fff0;
    color: #2e7d32;
    border-left-color: #4caf50;
    display: block;
}

.wc-otp-login-wrapper .otp-status.error {
    background: #fff0f0;
    color: #c62828;
    border-left-color: #e53935;
    display: block;
}

.wc-otp-login-wrapper .otp-status.info {
    background: #f0f8ff;
    color: #1565c0;
    border-left-color: #42a5f5;
    display: block;
}

/* Email Input - stile WooCommerce form-row */
.wc-otp-login-wrapper .otp-email-section {
    margin-bottom: 0;
}

.wc-otp-login-wrapper .otp-email-section .form-row {
    margin: 0 0 1em 0;
    padding: 0;
}

.wc-otp-login-wrapper .otp-email-section label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 0.35em;
    color: #333;
}

.wc-otp-login-wrapper .otp-email-section label .required {
    color: #e2401c;
    border: 0;
}

.wc-otp-login-wrapper .otp-email-section input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7em 0.8em;
    font-size: 0.95em;
    line-height: 1.4;
    border: 1px solid #d5d8dc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wc-otp-login-wrapper .otp-email-section input[type="email"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* Pulsante Invio OTP - stile WooCommerce button.alt */
.wc-otp-login-wrapper .otp-button-section {
    margin-top: 0.5em;
}

.wc-otp-login-wrapper button.otp-send-btn {
    width: 100%;
    margin-top: 0;
    padding: 0.8em 1.2em !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    white-space: normal;
    transition: all 0.2s ease;
}

/* Pulsante Verifica OTP */
.wc-otp-login-wrapper button.otp-verify-btn {
    width: 100%;
    margin-top: 0.5em;
    padding: 0.8em 1.2em !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    white-space: normal;
    transition: all 0.2s ease;
}

/* OTP Input Group */
.wc-otp-login-wrapper .otp-input-section {
    margin-top: 0.5em;
}

.wc-otp-login-wrapper .otp-input-section .form-row {
    margin: 0;
    padding: 0;
}

.wc-otp-login-wrapper .otp-input-section label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 0.35em;
    color: #333;
}

.wc-otp-login-wrapper .otp-input-section label .required {
    color: #e2401c;
    border: 0;
}

.wc-otp-login-wrapper .otp-input-group {
    display: flex;
    gap: 0.5em;
    align-items: center;
    margin: 0.5em 0;
}

.wc-otp-login-wrapper .otp-input-group input[type="text"] {
    flex: 1;
    text-align: center;
    font-size: 1.4em;
    letter-spacing: 0.5em;
    padding: 0.7em 0.5em;
    border: 1px solid #d5d8dc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wc-otp-login-wrapper .otp-input-group input[type="text"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* Timer */
.wc-otp-login-wrapper .otp-timer {
    font-size: 0.8em;
    color: #999;
    margin-top: 0.5em;
    text-align: center;
}

/* Pulsante Resend */
.wc-otp-login-wrapper .otp-resend-section {
    margin-top: 0.5em;
}

.wc-otp-login-wrapper button.otp-resend-btn {
    width: 100%;
    margin-top: 0;
}

/* ==========================================================================
   Messaggio di benvenuto post-login
   ========================================================================== */

.wc-otp-welcome-message {
    background: #f0fff0;
    color: #2e7d32;
    padding: 1em 1.2em;
    border-radius: 4px;
    margin-bottom: 1.5em;
    border-left: 4px solid #4caf50;
    text-align: center;
    font-size: 0.95em;
    line-height: 1.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .wc-otp-checkout-wrapper {
        padding: 1em;
    }

    .wc-otp-login-wrapper .otp-input-group {
        flex-direction: column;
        gap: 0.3em;
    }

    .wc-otp-login-wrapper .otp-input-group input[type="text"] {
        width: 100%;
        font-size: 1.2em;
    }
}
