/* =========================================================
   MAHALAXMI TRADERS — OTP VERIFICATION MODAL
   File: css/otp-verify.css
   Reusable across Bulk Order & Contact pages.
   All classes use "otp-" prefix to avoid collisions.
   ========================================================= */

/* ---- BACKDROP & MODAL SHELL ---- */
.otp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.otp-overlay.active {
    opacity: 1;
    visibility: visible;
}

.otp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 28, 21, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.otp-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #fcfaf5;
    border-radius: 20px;
    box-shadow:
        0 24px 80px rgba(15, 61, 46, 0.25),
        0 0 0 1px rgba(201, 154, 68, 0.15);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.otp-overlay.active .otp-card {
    transform: translateY(0) scale(1);
}

/* ---- TOP ACCENT BAR ---- */
.otp-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0f3d2e, #c99a44, #0f3d2e);
}

/* ---- CLOSE BUTTON ---- */
.otp-close-btn {
    position: absolute;
    top: 14px; right: 14px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(15, 61, 46, 0.12);
    background: rgba(246, 241, 231, 0.8);
    color: #5d665f;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    z-index: 2;
}

.otp-close-btn:hover {
    background: #0f3d2e;
    color: #fff;
    border-color: #0f3d2e;
}

/* ---- HEADER SECTION ---- */
.otp-header {
    padding: 36px 28px 0;
    text-align: center;
}

.otp-icon-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 61, 46, 0.08), rgba(201, 154, 68, 0.08));
    border: 2px solid rgba(15, 61, 46, 0.1);
    animation: otpPulseRing 2s ease-in-out infinite;
}

@keyframes otpPulseRing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15, 61, 46, 0.1); }
    50% { box-shadow: 0 0 0 10px rgba(15, 61, 46, 0); }
}

.otp-icon-ring i {
    font-size: 28px;
    background: linear-gradient(135deg, #0f3d2e, #1a5e48);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.otp-header h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f3d2e;
    margin-bottom: 6px;
    line-height: 1.3;
}

.otp-header p {
    font-size: 13.5px;
    color: #5d665f;
    line-height: 1.55;
    margin-bottom: 0;
}

.otp-phone-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 7px 16px;
    background: rgba(15, 61, 46, 0.05);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #0f3d2e;
    letter-spacing: 0.5px;
}

.otp-phone-display i {
    color: #c99a44;
    font-size: 13px;
}

.otp-edit-phone {
    background: none;
    border: none;
    color: #c99a44;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 4px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.otp-edit-phone:hover {
    color: #0f3d2e;
}

/* ---- OTP INPUT BOXES ---- */
.otp-body {
    padding: 24px 28px 0;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.otp-digit {
    width: 50px;
    height: 58px;
    border: 2px solid #e7e0d2;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    font-family: "DM Sans", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f3d2e;
    caret-color: #c99a44;
    outline: none;
    transition: all 0.25s ease;
    -moz-appearance: textfield;
}

.otp-digit::-webkit-inner-spin-button,
.otp-digit::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-digit:focus {
    border-color: #c99a44;
    box-shadow: 0 0 0 3px rgba(201, 154, 68, 0.15);
    transform: translateY(-2px);
}

.otp-digit.filled {
    border-color: #0f3d2e;
    background: rgba(15, 61, 46, 0.03);
}

.otp-digit.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
    animation: otpShake 0.4s ease;
}

.otp-digit.success {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.04);
}

@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---- ERROR BANNER ---- */
.otp-error-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.07);
    border: 1px solid rgba(231, 76, 60, 0.18);
    color: #c0392b;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

.otp-error-banner.show {
    display: flex;
}

.otp-error-banner i {
    font-size: 14px;
    flex-shrink: 0;
}

/* ---- VERIFY BUTTON ---- */
.otp-verify-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f3d2e 0%, #1a5e48 100%);
    color: #fff;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.otp-verify-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201, 154, 68, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.otp-verify-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.otp-verify-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(15, 61, 46, 0.3);
}

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

.otp-verify-btn .otp-btn-text { position: relative; z-index: 1; }
.otp-verify-btn i { position: relative; z-index: 1; }

/* Spinner inside button */
.otp-verify-btn .otp-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: otpSpin 0.7s linear infinite;
}

.otp-verify-btn.loading .otp-btn-text,
.otp-verify-btn.loading i { display: none; }
.otp-verify-btn.loading .otp-spinner { display: block; }

@keyframes otpSpin {
    to { transform: rotate(360deg); }
}

/* ---- RESEND / TIMER ROW ---- */
.otp-footer {
    padding: 16px 28px 28px;
    text-align: center;
}

.otp-timer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #5d665f;
    margin-bottom: 6px;
}

.otp-timer-row i {
    font-size: 12px;
    color: #c99a44;
}

.otp-countdown {
    font-weight: 700;
    color: #0f3d2e;
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    display: inline-block;
}

.otp-resend-btn {
    background: none;
    border: none;
    color: #c99a44;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
    display: none;
}

.otp-resend-btn:hover {
    color: #0f3d2e;
}

.otp-resend-btn.show {
    display: inline-block;
}

.otp-resend-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Sending indicator text */
.otp-sending-text {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #5d665f;
    padding: 10px 0;
}

.otp-sending-text.show { display: flex; }

.otp-sending-text .otp-mini-spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(15, 61, 46, 0.15);
    border-top-color: #0f3d2e;
    border-radius: 50%;
    animation: otpSpin 0.7s linear infinite;
}

/* ---- SUCCESS STATE ---- */
.otp-success-state {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 36px 28px;
    text-align: center;
}

.otp-success-state.show { display: flex; }

.otp-success-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.04));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: otpPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.otp-success-check i {
    font-size: 30px;
    color: #27ae60;
}

@keyframes otpPopIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.otp-success-state h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.25rem;
    color: #0f3d2e;
    margin-bottom: 6px;
}

.otp-success-state p {
    font-size: 13px;
    color: #5d665f;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
    .otp-card {
        border-radius: 16px;
    }

    .otp-header {
        padding: 28px 20px 0;
    }

    .otp-body {
        padding: 20px 20px 0;
    }

    .otp-footer {
        padding: 14px 20px 24px;
    }

    .otp-inputs {
        gap: 7px;
    }

    .otp-digit {
        width: 44px;
        height: 52px;
        font-size: 20px;
        border-radius: 10px;
    }

    .otp-icon-ring {
        width: 60px;
        height: 60px;
    }

    .otp-icon-ring i {
        font-size: 24px;
    }

    .otp-header h3 {
        font-size: 1.15rem;
    }
}

/* =========================================================
   CONFIRMATION & THANK YOU POPUP MODALS (Bulk Order & Contact)
   ========================================================= */

.bo-modal-overlay,
.ct-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.bo-modal-overlay.active,
.ct-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bo-modal-backdrop,
.ct-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 28, 21, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bo-modal-card,
.ct-modal-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fcfaf5;
    border-radius: 20px;
    box-shadow:
        0 24px 80px rgba(15, 61, 46, 0.3),
        0 0 0 1px rgba(201, 154, 68, 0.2);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 32px 28px;
    box-sizing: border-box;
}

.bo-modal-overlay.active .bo-modal-card,
.ct-modal-overlay.active .ct-modal-card {
    transform: translateY(0) scale(1);
}

.bo-modal-card::before,
.ct-modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0f3d2e, #c99a44, #0f3d2e);
}

/* Close button */
.bo-modal-close,
.ct-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(15, 61, 46, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.bo-modal-close:hover,
.ct-modal-close:hover {
    background: rgba(15, 61, 46, 0.12);
    color: #0f3d2e;
    transform: rotate(90deg);
}

/* Header & Icon */
.bo-modal-header,
.ct-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.bo-modal-icon-ring,
.ct-success-icon-ring,
.bo-success-ring {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15,61,46,0.1), rgba(201,154,68,0.15));
    border: 2px solid rgba(201, 154, 68, 0.4);
    color: #0f3d2e;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(15, 61, 46, 0.1);
}

.bo-success-ring,
.ct-success-icon-ring {
    background: linear-gradient(135deg, #0f3d2e, #1a5c46);
    color: #c99a44;
    border: 2px solid #c99a44;
    animation: successPulse 2s infinite ease-in-out;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 154, 68, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(201, 154, 68, 0); }
}

.bo-modal-header h3,
.ct-modal-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f3d2e;
    margin: 0 0 8px;
}

.bo-modal-header p,
.ct-modal-header p {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* Reference badges */
.bo-ref-tag,
.bo-ref-badge,
.ct-ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(201, 154, 68, 0.12);
    border: 1px solid rgba(201, 154, 68, 0.3);
    border-radius: 30px;
    font-size: 0.88rem;
    color: #0f3d2e;
}

.bo-ref-tag strong,
.bo-ref-badge strong,
.ct-ref-pill strong {
    color: #a07828;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Summary Grid */
.bo-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #fff;
    border: 1px solid #ede8dc;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
}

.bo-summary-item {
    display: flex;
    flex-direction: column;
}

.bo-summary-item.full-width {
    grid-column: span 2;
}

.bo-summary-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8c97a5;
    margin-bottom: 3px;
    font-weight: 600;
}

.bo-summary-val {
    font-size: 0.94rem;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
}

.bo-summary-val.highlight {
    color: #0f3d2e;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Contact summary box */
.ct-enquiry-summary {
    background: #fff;
    border: 1px solid #ede8dc;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}

.ct-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #ede8dc;
    font-size: 0.92rem;
}

.ct-summary-row:last-child {
    border-bottom: none;
}

.ct-summary-row .label {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-summary-row .val {
    font-weight: 600;
    color: #0f3d2e;
    text-align: right;
}

.ct-response-note,
.bo-dispatch-note {
    background: rgba(15, 61, 46, 0.05);
    border-left: 3px solid #c99a44;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Action Buttons */
.bo-modal-actions,
.ct-modal-actions {
    display: flex;
    gap: 12px;
}

.bo-modal-actions.vertical,
.ct-modal-actions {
    flex-direction: column;
}

.bo-btn-primary,
.bo-btn-secondary,
.bo-btn-whatsapp,
.ct-btn-whatsapp,
.ct-btn-done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.bo-btn-primary,
.ct-btn-done {
    background: linear-gradient(135deg, #0f3d2e, #1a5c46);
    color: #fff;
    box-shadow: 0 4px 15px rgba(15, 61, 46, 0.25);
}

.bo-btn-primary:hover,
.ct-btn-done:hover {
    background: linear-gradient(135deg, #144f3b, #216f55);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 61, 46, 0.35);
}

.bo-btn-secondary {
    background: #ede8dc;
    color: #475569;
}

.bo-btn-secondary:hover {
    background: #e2dccf;
    color: #0f3d2e;
}

.bo-btn-whatsapp,
.ct-btn-whatsapp {
    background: #25d366;
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    font-size: 1rem;
}

.bo-btn-whatsapp:hover,
.ct-btn-whatsapp:hover {
    background: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    color: #fff;
}

@media (max-width: 480px) {
    .bo-modal-card,
    .ct-modal-card {
        padding: 24px 18px;
    }
    .bo-summary-grid {
        grid-template-columns: 1fr;
    }
    .bo-summary-item.full-width {
        grid-column: span 1;
    }
    .bo-modal-actions {
        flex-direction: column;
    }
}

