/**
 * LM WhatsApp Notifications & OTP - Public Frontend Stylesheet
 */

:root {
    --lm-wa-color-primary: #25D366;
    --lm-wa-color-dark: #075E54;
    --lm-wa-color-hover: #128C7E;
    --lm-wa-color-bg: #FFFFFF;
    --lm-wa-color-border: #E2E8F0;
    --lm-wa-color-text: #1E293B;
    --lm-wa-color-muted: #64748B;
    --lm-wa-color-danger: #EF4444;
    --lm-wa-color-success: #10B981;
}

/* ==========================================================================
   WooCommerce My Account Login / Register Replacement Card
   ========================================================================== */
.lm-wa-auth-wrapper {
    max-width: 460px;
    margin: 30px auto 50px auto;
    padding: 0 15px;
    box-sizing: border-box;
    font-family: inherit;
}

.lm-wa-auth-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.08), 0 5px 15px -3px rgba(0, 0, 0, 0.03);
    border: 1px solid #E2E8F0;
    padding: 36px 30px;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.lm-wa-auth-header {
    margin-bottom: 24px;
}

.lm-wa-auth-header.lm-wa-compact {
    margin-bottom: 16px;
    text-align: left;
}

.lm-wa-auth-icon {
    width: 60px;
    height: 60px;
    background: #DCFCE7;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lm-wa-auth-header h2 {
    margin: 0 0 8px 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
}

.lm-wa-auth-header h4 {
    margin: 0 0 4px 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
}

.lm-wa-auth-header p {
    margin: 0 !important;
    font-size: 14px !important;
    color: #64748B !important;
    line-height: 1.5 !important;
}

.lm-wa-step-box {
    animation: lmWaFadeIn 0.25s ease;
}

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

/* Unified Phone Input Group with Country Dropdown */
.lm-wa-phone-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #CBD5E1;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.2s ease;
    margin-top: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lm-wa-phone-group:focus-within {
    border-color: #25D366 !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.22) !important;
}

.lm-wa-country-select-wrap {
    background: #F8FAFC;
    border-right: 1px solid #E2E8F0;
    max-width: 140px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.lm-wa-country-select {
    width: 100% !important;
    height: 48px !important;
    border: none !important;
    background: transparent !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    padding: 0 8px !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
    text-overflow: ellipsis;
}

.lm-wa-phone-number-input {
    flex: 1 !important;
    height: 48px !important;
    border: none !important;
    background: transparent !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #0F172A !important;
    padding: 0 14px !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: auto !important;
}

.lm-wa-input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #94A3B8;
    text-align: left;
}

.lm-wa-btn-lg {
    height: 48px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
    margin-top: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.lm-wa-optional-fields-toggle {
    margin: 14px 0 8px 0;
    text-align: left;
}

.lm-wa-optional-fields-toggle a {
    font-size: 13px;
    color: #075E54;
    font-weight: 600;
    text-decoration: none;
}

.lm-wa-optional-fields-toggle a:hover {
    text-decoration: underline;
}

.lm-wa-extra-fields-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: left;
}

.lm-wa-extra-fields-box label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 4px;
}

.lm-wa-extra-fields-box input {
    margin-bottom: 10px;
    width: 100%;
}

.lm-wa-form-row-group {
    display: flex;
    gap: 12px;
}

.lm-wa-form-col {
    flex: 1;
}

.lm-wa-otp-prompt {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 18px;
}

.lm-wa-auth-footer {
    margin-top: 18px;
    font-size: 13px;
    color: #64748B;
}

.lm-wa-auth-footer a {
    color: #075E54;
    font-weight: 600;
    text-decoration: underline;
}

.lm-wa-auth-switch-bar {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #E2E8F0;
}

.lm-wa-switch-link {
    color: #075E54 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.lm-wa-switch-link:hover {
    text-decoration: underline !important;
}

/* ==========================================================================
   Checkout Login Box Override
   ========================================================================== */
.lm-wa-checkout-login-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ==========================================================================
   OTP Modal Dialog (Popup Mode)
   ========================================================================== */
.lm-wa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lm-wa-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.lm-wa-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 32px 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    z-index: 2;
    animation: lmWaModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes lmWaModalPop {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.lm-wa-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    color: #94A3B8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.lm-wa-modal-close:hover {
    color: #1E293B;
}

.lm-wa-modal-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.lm-wa-circle-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #DCFCE7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lm-wa-modal-title {
    margin: 0 0 8px 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
}

.lm-wa-modal-desc {
    font-size: 14px !important;
    color: #64748B !important;
    margin: 0 0 24px 0 !important;
    line-height: 1.5 !important;
}

.lm-wa-phone-highlight {
    color: #0F172A;
    display: inline-block;
}

/* Digit Input Row */
.lm-wa-otp-inputs-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.lm-wa-digit-input {
    width: 48px !important;
    height: 54px !important;
    border: 2px solid #CBD5E1 !important;
    border-radius: 10px !important;
    text-align: center !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    background: #F8FAFC !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.lm-wa-digit-input:focus {
    border-color: #25D366 !important;
    background: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.25) !important;
}

.lm-wa-btn-primary {
    background: #25D366 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lm-wa-btn-primary:hover {
    background: #128C7E !important;
}

.lm-wa-btn-success {
    background: #10B981 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.lm-wa-btn-block {
    width: 100% !important;
    display: block !important;
}

.lm-wa-modal-footer {
    margin-top: 18px;
    font-size: 13px;
    color: #64748B;
}

.lm-wa-modal-footer a {
    color: #075E54;
    text-decoration: underline;
    font-weight: 600;
}

.lm-wa-sep {
    margin: 0 8px;
    color: #CBD5E1;
}

.lm-wa-countdown {
    color: #64748B;
    font-size: 13px;
}

/* ==========================================================================
   Inline Verification Box (Checkout)
   ========================================================================== */
.lm-wa-checkout-otp-box {
    margin: 20px 0;
}

.lm-wa-inline-verification-container {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
}

.lm-wa-inline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 12px;
}

.lm-wa-hint {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
}

.lm-wa-badge-verified {
    background: #DCFCE7;
    color: #15803D;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   WhatsApp Opt-in Checkbox (Checkout)
   ========================================================================== */
.lm-wa-optin-checkbox-wrap {
    margin: 15px 0;
    padding: 12px 16px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
}

.lm-wa-optin-label {
    font-size: 14px;
    color: #166534;
    font-weight: 600;
}

/* ==========================================================================
   Floating WhatsApp Chat Widget
   ========================================================================== */
.lm-wa-chat-widget {
    position: fixed;
    z-index: 99999;
    bottom: 24px;
}

.lm-wa-pos-right { right: 24px; }
.lm-wa-pos-left  { left: 24px; }

@media (max-width: 767px) {
    .lm-wa-hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .lm-wa-hide-desktop { display: none !important; }
}

/* Floating Trigger Button */
.lm-wa-floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
}

.lm-wa-floating-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5);
}

.lm-wa-btn-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.6;
    animation: lmWaPulse 2s infinite;
    z-index: 1;
}

@keyframes lmWaPulse {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.lm-wa-btn-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lm-wa-btn-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EF4444;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* Chat Popup Window */
.lm-wa-chat-popup {
    position: absolute;
    bottom: 75px;
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: lmWaPopupSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #E2E8F0;
}

.lm-wa-pos-right .lm-wa-chat-popup { right: 0; }
.lm-wa-pos-left .lm-wa-chat-popup  { left: 0; }

@keyframes lmWaPopupSlide {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.lm-wa-chat-popup-header {
    background: #075E54;
    color: #ffffff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.lm-wa-avatar {
    width: 40px;
    height: 40px;
    background: #128C7E;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lm-wa-header-info h4 {
    margin: 0 0 2px 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.lm-wa-online-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 4px;
}

.lm-wa-pulse-dot {
    width: 7px;
    height: 7px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
}

.lm-wa-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.lm-wa-popup-close:hover {
    color: #ffffff;
}

.lm-wa-chat-popup-body {
    padding: 16px;
    background: #ECE5DD;
    min-height: 90px;
}

.lm-wa-chat-msg-bubble {
    background: #ffffff;
    border-radius: 0 10px 10px 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: #111827;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 90%;
}

.lm-wa-chat-msg-bubble p {
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.lm-wa-chat-time {
    font-size: 10px;
    color: #9CA3AF;
    display: block;
    text-align: right;
}

.lm-wa-chat-popup-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #E5E7EB;
}

.lm-wa-start-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s ease;
}

.lm-wa-start-chat-btn:hover {
    background: #128C7E;
}

/* Status helper text */
.lm-wa-status-msg {
    margin-top: 10px;
    font-size: 13px;
}
.lm-wa-status-msg.error { color: #DC2626; }
.lm-wa-status-msg.success { color: #16A34A; }
