/* ===========================
   Login Aromatica OTP – My Account Page
   Design moderne + compatible Woodmart
   =========================== */

/* Container principal */
.aromatica-otp-container {
    background: #ffffff;
    border: 2px solid #eef2f7;
    border-radius: 16px;
    padding: 32px 28px;
    margin: 0 auto 30px;
    max-width: 420px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.aromatica-otp-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #25D366, #128C7E);
}

.aromatica-otp-container:focus-within {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Titre + sous-titre */
.aromatica-otp-container h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
}

.aromatica-otp-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* Étapes */
.aromatica-otp-step-1,
.aromatica-otp-step-2 {
    transition: background-color 0.2s ease, padding 0.2s ease;
}

.aromatica-otp-step-1.is-active,
.aromatica-otp-step-2.is-active {
    background: #f9fafb;
    border-radius: 12px;
    padding: 10px 12px;
}

/* Phone Input Wrapper */
.aromatica-phone-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 5px 14px;
    transition: all 0.3s ease;
}

.aromatica-phone-wrapper:focus-within {
    border-color: #25D366;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.1);
}

.aromatica-phone-icon {
    font-size: 18px;
    margin-right: 8px;
    opacity: 0.7;
}

.aromatica-otp-container input[type="tel"] {
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    padding: 9px 0;
    width: 100%;
    outline: none;
    box-shadow: none;
}

/* États d'erreur / succès */
.aromatica-otp-container.has-error .aromatica-phone-wrapper {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.aromatica-otp-container.has-success .aromatica-phone-wrapper {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

/* Groupe des 4 digits */
.aromatica-digit-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 14px;
}

.aromatica-digit {
    width: 52px !important;
    height: 52px;
    font-size: 22px !important;
    font-weight: 700;
    text-align: center;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #333;
    transition: all 0.2s ease;
    padding: 0 !important;
}

.aromatica-digit:focus {
    border-color: #25D366 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.15) !important;
    outline: none;
}

/* Boutons génériques */
.aromatica-btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background-color: #111;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
}

.aromatica-btn:hover {
    background-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.aromatica-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Bouton WhatsApp */
.aromatica-whatsapp-btn {
    background-color: #25D366 !important;
    color: #fff !important;
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.aromatica-whatsapp-btn:hover {
    background-color: #128C7E !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.aromatica-btn-icon svg {
    fill: currentColor;
}

/* Bouton SMS */
.aromatica-sms-btn {
    background-color: #3498db !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.aromatica-sms-btn:hover {
    background-color: #2980b9 !important;
}

/* Bouton vérifier */
.aromatica-verify-btn {
    background-color: #2c3e50 !important;
    color: #fff !important;
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 14px;
}

/* Timer */
#aromatica-timer-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff0f0;
    color: #e74c3c;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

/* Fallback links */
.aromatica-fallback-text {
    text-align: center;
    margin-top: 10px;
}

.aromatica-fallback-text a {
    color: #7f8c8d;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px dashed #bdc3c7;
    transition: color 0.3s, border-bottom 0.3s;
}

.aromatica-fallback-text a:hover {
    color: #2c3e50;
    border-bottom-style: solid;
}

/* Resend wrappers */
.aromatica-resend-wrapper {
    text-align: center;
    margin-top: 8px;
}

.aromatica-resend-wrapper a {
    color: #3498db;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px dashed #3498db;
    transition: all 0.3s;
}

.aromatica-resend-wrapper a:hover {
    color: #2980b9;
    border-bottom-style: solid;
}

/* Messages */
#aromatica-otp-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    display: none;
}

#aromatica-otp-message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

#aromatica-otp-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Succès final */
.aromatica-success-checkmark {
    text-align: center;
    padding: 16px;
}

.aromatica-success-checkmark::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    margin-bottom: 12px;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.aromatica-success-checkmark h3 {
    color: #25D366;
    margin-bottom: 4px;
}

/* Spinner */
.aromatica-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: aromatica-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes aromatica-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Actions OTP */
.aromatica-otp-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.aromatica-otp-actions button {
    flex: 1;
    margin-top: 0;
}

/* Accessibilité */
.aromatica-otp-container input:focus,
.aromatica-otp-container button:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* ===========================
   Modern Theme Overrides
   =========================== */

.aromatica-otp-container.aromatica-theme-modern {
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 20px;
    padding: 32px 30px;
    box-shadow: 0 14px 44px rgba(18, 140, 126, 0.08);
}

.aromatica-theme-modern::before {
    height: 6px;
    background: linear-gradient(90deg, #25D366 0%, #128C7E 50%, #0b5c4f 100%);
}

.aromatica-theme-modern .aromatica-phone-wrapper {
    background: #f3f6fa;
    border-color: #dbe5ef;
    border-radius: 14px;
    padding: 8px 16px;
}

.aromatica-theme-modern .aromatica-otp-container input[type="tel"] {
    font-size: 18px;
    font-weight: 600;
}

.aromatica-theme-modern .aromatica-digit-group {
    gap: 14px;
    margin: 12px 0 16px;
}

.aromatica-theme-modern .aromatica-digit {
    width: 56px !important;
    height: 56px;
    border-radius: 14px !important;
    border-color: #dae2ea !important;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%) !important;
}

.aromatica-theme-modern .aromatica-digit:focus {
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.2) !important;
}

.aromatica-theme-modern .aromatica-digit-group.aromatica-shake {
    animation: aromatica-shake 0.4s linear;
}

@keyframes aromatica-shake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-3px);
    }

    40% {
        transform: translateX(3px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}

.aromatica-otp-container.aromatica-theme-modern.aromatica-pulse {
    animation: aromatica-pulse 600ms ease;
}

@keyframes aromatica-pulse {
    0% {
        box-shadow: 0 14px 44px rgba(18, 140, 126, 0.08);
    }

    50% {
        box-shadow: 0 20px 60px rgba(37, 211, 102, 0.18);
    }

    100% {
        box-shadow: 0 14px 44px rgba(18, 140, 126, 0.08);
    }
}

.aromatica-theme-modern .aromatica-btn {
    border-radius: 14px;
    padding: 16px;
    font-size: 15px;
}

.aromatica-theme-modern .aromatica-whatsapp-btn {
    background-image: linear-gradient(90deg, #25D366, #128C7E);
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35);
}

.aromatica-theme-modern .aromatica-whatsapp-btn:hover {
    filter: brightness(0.95);
}

.aromatica-theme-modern .aromatica-sms-btn {
    background-image: linear-gradient(90deg, #3498db, #2980b9);
}

.aromatica-theme-modern #aromatica-timer-wrapper {
    background: #eef3f9;
    color: #2c3e50;
    border-radius: 20px;
}

.aromatica-theme-modern #aromatica-otp-message {
    border-left: 4px solid transparent;
}

.aromatica-theme-modern #aromatica-otp-message.success {
    background-color: #ecf9f1;
    color: #1a7f3b;
    border-color: #2dd168;
}

.aromatica-theme-modern #aromatica-otp-message.error {
    background-color: #fff3f3;
    color: #b00020;
    border-color: #ff6b6b;
}

.aromatica-theme-modern.has-error .aromatica-phone-wrapper {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.aromatica-theme-modern.has-success .aromatica-phone-wrapper {
    border-color: #2dd168;
    box-shadow: 0 0 0 3px rgba(45, 209, 104, 0.2);
}

.aromatica-theme-modern .aromatica-success-checkmark::before {
    width: 64px;
    height: 64px;
    font-size: 30px;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 480px) {
    .aromatica-otp-container {
        padding: 20px 16px;
        margin-bottom: 20px;
        border-radius: 14px;
    }

    .aromatica-otp-container h2 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .aromatica-otp-subtitle {
        font-size: 12px;
        margin-bottom: 14px;
    }

    .aromatica-phone-wrapper {
        padding: 4px 10px;
    }

    .aromatica-otp-container input[type="tel"] {
        font-size: 16px;
    }

    .aromatica-digit {
        width: 44px !important;
        height: 44px;
        font-size: 18px !important;
    }

    .aromatica-digit-group {
        gap: 8px;
        margin: 6px 0 10px;
    }

    .aromatica-btn,
    .aromatica-whatsapp-btn,
    .aromatica-sms-btn {
        font-size: 13px;
        padding: 12px;
    }

    #aromatica-timer-wrapper {
        padding: 6px 10px;
        font-size: 12px;
    }

    .aromatica-otp-actions {
        flex-direction: column;
        gap: 8px;
    }

    #aromatica-otp-message {
        font-size: 12px;
    }

    .aromatica-success-checkmark::before {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

@media (max-width: 360px) {
    .aromatica-digit {
        width: 40px !important;
        height: 40px;
        font-size: 16px !important;
    }

    .aromatica-otp-container {
        padding: 16px 12px;
    }
}

/* ===========================
   Woodmart Theme Compatibility
   =========================== */

.woocommerce-account .aromatica-otp-container {
    margin-top: 0;
}

/* Hide WooCommerce default login heading */
.woocommerce-account h2:not(.aromatica-otp-container h2) {
    display: none;
}

/* Override Woodmart button styles */
.woodmart-theme .aromatica-whatsapp-btn,
.woodmart-theme .aromatica-sms-btn,
.woodmart-theme .aromatica-verify-btn {
    line-height: 1.4;
    height: auto;
}

/* ===========================
   Popup OTP Styles (Woodmart Header)
   =========================== */

.aromatica-popup-otp-wrapper {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.aromatica-popup-tabs {
    display: flex;
    margin-bottom: 15px;
    gap: 5px;
}

.aromatica-popup-tab {
    flex: 1;
    background: #f5f5f5;
    border: none;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.aromatica-popup-tab.active {
    background: #25D366;
    color: white;
}

.aromatica-popup-tab:hover:not(.active) {
    background: #e8e8e8;
}

.aromatica-popup-phone-form {
    display: none;
}

.aromatica-popup-phone-form.active {
    display: block;
}

.aromatica-popup-phone-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.aromatica-popup-phone-wrapper:focus-within {
    border-color: #25D366;
    background: #fff;
}

.aromatica-popup-phone-icon {
    font-size: 16px;
    margin-right: 8px;
}

.aromatica-popup-phone-input {
    border: none !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 500;
    padding: 6px 0 !important;
    width: 100%;
    outline: none !important;
    box-shadow: none !important;
}

.aromatica-popup-otp-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.aromatica-popup-whatsapp-btn {
    background: linear-gradient(90deg, #25D366, #128C7E);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.aromatica-popup-whatsapp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.aromatica-popup-verify-btn {
    background: #2c3e50;
}

.aromatica-popup-verify-btn:hover {
    background: #34495e;
}

.aromatica-popup-sms-fallback {
    text-align: center;
    margin: 10px 0 0;
    font-size: 12px;
}

.aromatica-popup-sms-fallback a {
    color: #7f8c8d;
    text-decoration: none;
    border-bottom: 1px dashed #bdc3c7;
}

.aromatica-popup-sms-fallback a:hover {
    color: #2c3e50;
}

.aromatica-popup-otp-label {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.aromatica-popup-digit-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.aromatica-popup-digit {
    width: 44px !important;
    height: 44px;
    font-size: 18px !important;
    font-weight: 700;
    text-align: center;
    border: 2px solid #e9ecef !important;
    border-radius: 10px !important;
    background: #fff !important;
    outline: none;
    transition: all 0.2s;
}

/* Popup Header */
.aromatica-popup-header {
    text-align: center;
    margin-bottom: 15px;
}

.aromatica-popup-header h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.aromatica-popup-header p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.aromatica-popup-digit:focus {
    border-color: #25D366 !important;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.2) !important;
}

.aromatica-popup-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
}

.aromatica-popup-actions a {
    color: #3498db;
    text-decoration: none;
}

.aromatica-popup-timer {
    color: #e74c3c;
    font-weight: 600;
}

.aromatica-popup-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    display: none;
}

.aromatica-popup-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
}

.aromatica-popup-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

/* ============================================
   WOODMART POPUP - CLEAN OTP-ONLY DISPLAY
   Only targets .login-dropdown-inner (popup)
   Does NOT affect the main /my-account/ page
   ============================================ */

/* Hide default WooCommerce form elements in popup */
.login-dropdown-inner .woocommerce-form-login>p.form-row,
.login-dropdown-inner .woocommerce-form-login>.form-row,
.login-dropdown-inner .woocommerce-form-login>p.woocommerce-form-row,
.login-dropdown-inner .woocommerce-form-login p.form-row-first,
.login-dropdown-inner .woocommerce-form-login p.form-row-last,
.login-dropdown-inner .woocommerce-form-login label[for="username"],
.login-dropdown-inner .woocommerce-form-login label[for="password"],
.login-dropdown-inner .woocommerce-form-login input#username,
.login-dropdown-inner .woocommerce-form-login input#password,
.login-dropdown-inner .woocommerce-form-login input[name="username"],
.login-dropdown-inner .woocommerce-form-login input[name="password"] {
    display: none !important;
}

/* Hide Remember Me checkbox */
.login-dropdown-inner .woocommerce-form-login__rememberme,
.login-dropdown-inner .woocommerce-form-login label.woocommerce-form-login__rememberme,
.login-dropdown-inner .woocommerce-form-login input#rememberme,
.login-dropdown-inner .woocommerce-form-login .form-row:has(input#rememberme) {
    display: none !important;
}

/* Hide Lost Password link */
.login-dropdown-inner .woocommerce-LostPassword,
.login-dropdown-inner .lost_password,
.login-dropdown-inner p.lost_password,
.login-dropdown-inner a[href*="lost-password"],
.login-dropdown-inner a[href*="mot-de-passe-perdu"] {
    display: none !important;
}

/* Hide default login button */
.login-dropdown-inner .woocommerce-form-login button[type="submit"],
.login-dropdown-inner .woocommerce-form-login button[name="login"],
.login-dropdown-inner .woocommerce-form-login .woocommerce-form-login__submit {
    display: none !important;
}

/* Hide password visibility toggle */
.login-dropdown-inner span.show-password-input,
.login-dropdown-inner .password-input {
    display: none !important;
}

/* Hide "Créer un compte" link in popup header */
.login-dropdown-inner .create-account-link,
.login-dropdown-inner a.create-account-link {
    display: none !important;
}

/* ============================================
   POPUP SPINNER & SUCCESS STATES
   ============================================ */

/* Spinner for popup buttons */
.aromatica-popup-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: aromatica-popup-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes aromatica-popup-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button loading state - keep button visible with spinner */
.aromatica-popup-otp-btn:disabled {
    opacity: 0.8;
    cursor: wait;
}

/* Verification button with spinner */
.aromatica-popup-verify-btn:disabled {
    background: linear-gradient(90deg, #3498db, #2980b9);
    min-height: 44px;
}

/* Message styling improvements */
.aromatica-popup-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;
    font-weight: 500;
}

.aromatica-popup-message.error {
    display: block;
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.aromatica-popup-message.success {
    display: block;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Success message styling - no ::before to avoid encoding issues */

/* SMS mode button styling */
.aromatica-popup-sms-btn {
    background: linear-gradient(90deg, #3498db, #2980b9) !important;
}