/* ATTOP99 OTP Plugin Styles */

/* Container */
.tbs-otp-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
}

.tbs-otp-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Icon Wrapper */
.tbs-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.tbs-icon-wrapper.tbs-icon-blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Typography */
.tbs-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin: 0 0 8px;
}

.tbs-subtitle {
    font-size: 14px;
    color: #718096;
    text-align: center;
    margin: 0 0 32px;
}

/* Form Elements */
.tbs-form-group {
    margin-bottom: 20px;
}

.tbs-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.tbs-phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tbs-phone-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tbs-phone-prefix {
    background: #f7fafc;
    padding: 14px 16px;
    font-weight: 600;
    color: #4a5568;
    border-right: 2px solid #e2e8f0;
}

.tbs-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
}

/* Info Box */
.tbs-info-box {
    background: #edf2f7;
    border-left: 4px solid #667eea;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 24px;
}

/* Button */
.tbs-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tbs-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.tbs-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* OTP Inputs */
.tbs-otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.tbs-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.tbs-otp-digit:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Timer */
.tbs-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 24px;
    font-size: 14px;
    color: #718096;
}

.tbs-resend-btn {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Back Button */
.tbs-back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.tbs-back-button:hover {
    color: #764ba2;
}

/* Footer */
.tbs-footer {
    text-align: center;
    font-size: 13px;
    color: #718096;
    margin-top: 24px;
}

.tbs-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Steps */
.tbs-otp-step {
    display: none;
}

.tbs-otp-step.active {
    display: block;
}

/* Messages */
.tbs-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

.tbs-message.tbs-error {
    background: #fed7d7;
    color: #c53030;
    border-left: 4px solid #c53030;
}

.tbs-message.tbs-success {
    background: #c6f6d5;
    color: #2f855a;
    border-left: 4px solid #2f855a;
}

/* Checkout Specific Styles */
.tbs-checkout-otp-section {
    margin: 24px 0;
    padding: 24px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.tbs-checkout-otp-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 16px;
}

.tbs-otp-status-wrapper .tbs-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
}

.tbs-verified .tbs-success {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2f855a;
    font-weight: 600;
    margin-bottom: 8px;
}

.tbs-change-phone {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .tbs-otp-container {
        padding: 32px 24px;
    }

    .tbs-otp-digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .tbs-otp-inputs {
        gap: 8px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tbs-otp-step.active {
    animation: fadeIn 0.3s ease;
}

/* OTP Error State */
.tbs-otp-digit.tbs-otp-error {
    border-color: #e53e3e !important;
    background-color: #fff5f5 !important;
    animation: shake 0.5s ease;
}

.tbs-otp-error-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fed7d7;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    margin: 16px 0;
    font-size: 14px;
    color: #c53030;
}

.tbs-error-icon {
    font-size: 18px;
}

.tbs-error-text {
    font-weight: 500;
}

/* Resend OTP Button (New improved version) */
.tbs-resend-wrapper {
    text-align: center;
    padding: 20px 0;
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.tbs-resend-notice {
    font-size: 14px;
    color: #718096;
    margin: 0 0 12px 0;
}

.tbs-resend-btn-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.tbs-resend-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(229, 62, 62, 0.4);
}

.tbs-resend-btn-new:active {
    transform: translateY(0);
}

.tbs-resend-btn-new svg {
    transition: transform 0.3s ease;
}

.tbs-resend-btn-new:hover svg {
    transform: rotate(360deg);
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* ============================================
   ENHANCED UX/UI - Phase 1: Visual Foundation
   ============================================ */

/* Enhanced Checkout OTP Section - Glassmorphism */
.tbs-checkout-otp-section[data-injected="true"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Subtle gradient overlay */
.tbs-checkout-otp-section[data-injected="true"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f56565 100%);
    border-radius: 16px 16px 0 0;
}

/* Enhanced Header with SVG Icon */
.tbs-checkout-otp-section h3 {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    margin: 0 0 16px 0 !important;
}

/* Lock Icon for Trust */
.tbs-lock-icon {
    width: 20px;
    height: 20px;
    color: #667eea;
}

/* Enhanced OTP Single Input */
.tbs-otp-single-input {
    width: 100% !important;
    height: 56px !important;
    text-align: center !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: 10px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    outline: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.tbs-otp-single-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    background: #ffffff !important;
}

.tbs-otp-single-input::placeholder {
    color: #a0aec0 !important;
    letter-spacing: 2px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

/* Input Valid State */
.tbs-otp-single-input.valid {
    border-color: #48bb78 !important;
    box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.15) !important;
}

/* Enhanced Countdown Display */
.tbs-countdown-display {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    margin-bottom: 16px !important;
    background: transparent !important;
    border-radius: 10px !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #4a5568 !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

.tbs-countdown-display.expiring {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    animation: pulse 1s ease-in-out infinite;
}

/* Circular Progress for Countdown */
.tbs-countdown-circle {
    width: 36px;
    height: 36px;
    position: relative;
}

.tbs-countdown-circle svg {
    transform: rotate(-90deg);
    width: 36px;
    height: 36px;
}

.tbs-countdown-circle .bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 3;
}

.tbs-countdown-circle .progress {
    fill: none;
    stroke: #667eea;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

/* Enhanced Buttons */
.tbs-checkout-request-otp,
.tbs-checkout-verify-otp {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Request OTP Button - Gradient */
.tbs-checkout-request-otp {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%) !important;
    color: white !important;
    padding: 14px 28px !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25) !important;
}

.tbs-checkout-request-otp:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.35) !important;
}

.tbs-checkout-request-otp:active:not(:disabled) {
    transform: translateY(0) !important;
}

/* Verify OTP Button - Green Gradient */
.tbs-checkout-verify-otp:not(:disabled) {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.25) !important;
}

.tbs-checkout-verify-otp:not(:disabled):hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.35) !important;
}

.tbs-checkout-verify-otp:disabled {
    background: #cbd5e0 !important;
    cursor: not-allowed !important;
}

/* Button Loading State */
.tbs-button-loading {
    pointer-events: none !important;
}

.tbs-button-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* Resend Button - Enhanced */
.tbs-resend-btn {
    background: transparent !important;
    color: #667eea !important;
    border: 2px solid #667eea !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.tbs-resend-btn:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px) !important;
}

/* Enhanced Verified State */
.tbs-verified {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%) !important;
    border: 1px solid rgba(72, 187, 120, 0.3) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    animation: successPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

@keyframes successPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Step Progress Indicator - Always one line */
.tbs-step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.tbs-step {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #a0aec0;
    font-weight: 500;
    white-space: nowrap;
}

.tbs-step.active {
    color: #667eea;
    font-weight: 600;
}

.tbs-step.completed {
    color: #48bb78;
}

.tbs-step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #718096;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    transition: all 0.3s ease;
}

.tbs-step.active .tbs-step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tbs-step.completed .tbs-step-number {
    background: #48bb78;
    color: white;
}

.tbs-step-connector {
    width: 40px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 8px;
    transition: background 0.3s ease;
}

.tbs-step.completed+.tbs-step-connector,
.tbs-step-connector.completed {
    background: #48bb78;
}

/* Trust Signals */
.tbs-trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    font-size: 12px;
    color: #718096;
}

.tbs-trust-badge svg {
    width: 14px;
    height: 14px;
    color: #667eea;
}

/* Privacy Message */
.tbs-privacy-text {
    text-align: center;
    font-size: 11px;
    color: #a0aec0;
    margin-top: 12px;
    line-height: 1.4;
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================
   Phase 3: Mobile Optimization
   ============================================ */

@media (max-width: 480px) {
    .tbs-checkout-otp-section[data-injected="true"] {
        margin: 12px 0 !important;
        padding: 20px 16px !important;
        border-radius: 12px !important;
    }

    .tbs-otp-single-input {
        height: 52px !important;
        font-size: 20px !important;
        letter-spacing: 8px !important;
    }

    .tbs-checkout-request-otp,
    .tbs-checkout-verify-otp {
        padding: 16px 24px !important;
        font-size: 16px !important;
        min-height: 52px !important;
    }

    .tbs-step-progress {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tbs-step-connector {
        width: 24px;
    }
}

/* ============================================
   Phase 7: Dark Mode Support (v3.2.7)
   ============================================ */

/* Dark Mode Support (Auto) */
@media (prefers-color-scheme: dark) {
    .tbs-checkout-otp-section[data-injected="true"] {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
        border: 1px solid rgba(71, 85, 105, 0.5) !important;
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    }

    .tbs-checkout-otp-section h3 {
        color: #f1f5f9 !important;
    }

    .tbs-otp-status-wrapper .tbs-info,
    .tbs-privacy-text,
    .tbs-trust-badge {
        color: #94a3b8 !important;
    }

    /* Input Fields */
    .tbs-otp-single-input,
    .tbs-phone-input-wrapper {
        background: rgba(51, 65, 85, 0.6) !important;
        border-color: #475569 !important;
        color: #f8fafc !important;
    }

    .tbs-otp-single-input:focus,
    .tbs-phone-input-wrapper:focus-within {
        background: rgba(51, 65, 85, 0.9) !important;
        border-color: #60a5fa !important;
        box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15) !important;
    }

    .tbs-otp-single-input::placeholder {
        color: #64748b !important;
    }

    /* Steps */
    .tbs-step-number {
        background: #334155 !important;
        color: #e2e8f0 !important;
    }

    /* Countdown */
    .tbs-countdown-display {
        background: rgba(51, 65, 85, 0.5) !important;
        color: #cbd5e1 !important;
    }

    .tbs-countdown-display span {
        color: #cbd5e1 !important;
    }

    /* Verified State */
    .tbs-verified {
        background: linear-gradient(135deg, rgba(6, 78, 59, 0.4) 0%, rgba(6, 95, 70, 0.3) 100%) !important;
        border-color: rgba(5, 150, 105, 0.3) !important;
    }

    .tbs-verified p {
        color: #34d399 !important;
    }

    /* Icons */
    .tbs-lock-icon {
        color: #60a5fa !important;
    }
}