.otp-section {
    display: none;
}

.otp-section.active {
    display: block;
}

.otp-back-btn {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin-bottom: 24px;
    transition: color 0.2s ease;
    direction: ltr;
    float: left;
}

.otp-back-btn:hover {
    color: var(--dark);
}

.otp-back-btn svg {
    width: 16px;
    height: 16px;
}

.otp-title {
    clear: both;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.2;
}

.otp-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 32px;
    line-height: 1.5;
}

.otp-email-display {
    color: var(--primary);
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
}

.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.otp-input-container[dir="rtl"] {
    flex-direction: row-reverse;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    background: var(--surface);
    color: var(--dark);
    transition: all 0.2s ease;
    caret-color: transparent;
    overflow: hidden;
}

.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 149, 246, 0.15);
    outline: none;
}

.otp-digit.filled {
    border-color: var(--primary);
    background: rgba(0, 149, 246, 0.05);
}

.otp-digit.error {
    border-color: #dc3545;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.otp-resend-container {
    text-align: center;
    margin-top: 24px;
}

.otp-resend-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.otp-resend-btn:hover:not(:disabled) {
    background: rgba(0, 149, 246, 0.1);
}

.otp-resend-btn:disabled {
    color: var(--gray);
    cursor: not-allowed;
}

.otp-error-message {
    color: #dc3545;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    display: none;
}

.otp-error-message.visible {
    display: block;
}

.otp-verifying {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gray);
    font-size: 14px;
    margin-top: 16px;
}

.otp-verifying.active {
    display: flex;
}

.otp-verifying.active + .otp-resend-container {
    display: none;
}


@media (max-width: 768px) {
    .otp-digit {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    .otp-input-container {
        gap: 6px;
    }

    .otp-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 380px) {
    .otp-digit {
        width: 36px;
        height: 44px;
        font-size: 18px;
    }

    .otp-input-container {
        gap: 4px;
    }
}


/* Delivery channel (WhatsApp / SMS) */
.channel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: #fff;
    flex-shrink: 0;
    vertical-align: middle;
}

.channel-icon svg {
    width: 70%;
    height: 70%;
    display: block;
}

.channel-icon-whatsapp {
    background: linear-gradient(160deg, #5ff17a 0%, #25d366 55%, #128c7e 100%);
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}

.channel-icon-sms-ios {
    background: linear-gradient(160deg, #6ef07f 0%, #34c759 60%, #1f9d3f 100%);
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.35);
}

.channel-icon-sms-android {
    background: linear-gradient(160deg, #5aa9ff 0%, #1a73e8 60%, #0b57d0 100%);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.35);
}

.channel-icon-sms-desktop {
    background: linear-gradient(160deg, #8e9aaf 0%, #5f6b7d 100%);
    box-shadow: 0 2px 6px rgba(95, 107, 125, 0.3);
}

.phone-channel-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 24px;
}

.phone-channel-icon {
    display: inline-flex;
}

.phone-channel-icon:empty {
    display: none;
}

.phone-channel-line.channel-swap .phone-channel-icon,
.phone-channel-line.channel-swap #phone-subtitle-text {
    animation: channelFade 0.35s ease;
}

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

.otp-channel-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin: -12px auto 24px;
    max-width: 320px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    text-align: start;
    animation: badgeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.otp-channel-badge[hidden] {
    display: none;
}

.otp-channel-badge.channel-whatsapp {
    border-color: rgba(37, 211, 102, 0.35);
    background: linear-gradient(180deg, rgba(37, 211, 102, 0.08), rgba(37, 211, 102, 0.02));
}

.otp-channel-badge.channel-sms {
    border-color: rgba(0, 0, 0, 0.1);
}

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

.otp-channel-badge-icon .channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.otp-channel-badge.channel-sms .channel-icon-sms-android {
    border-radius: 50%;
}

.otp-channel-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.otp-channel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.otp-channel-status {
    font-size: 12.5px;
    color: var(--gray);
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 6px;
}

.otp-channel-status.pending::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f5a623;
    flex-shrink: 0;
    animation: statusPulse 1.2s ease-in-out infinite;
}

.otp-channel-status.delivered::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #25d366;
    flex-shrink: 0;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
}

.otp-channel-notice {
    font-size: 13px;
    color: var(--dark);
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    margin: -8px auto 20px;
    max-width: 320px;
    line-height: 1.4;
    animation: badgeIn 0.35s ease;
}

.otp-channel-notice[hidden] {
    display: none;
}

.otp-alt-channel-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--dark);
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.otp-alt-channel-btn[hidden] {
    display: none;
}

.otp-alt-channel-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.otp-alt-channel-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.otp-alt-channel-icon .channel-icon {
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

.otp-resend-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
