/* Ecomdrive OTP Modal - Modern Design */

.ecomdrive-otp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.ecomdrive-otp-content {
    position: absolute;
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 380px;
    width: 90%;
    text-align: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: slideUp 0.3s ease;
}

/* Lock Icon */
.otp-icon-header {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.otp-icon-header svg {
    width: 32px;
    height: 32px;
    color: #16a34a;
}

.ecomdrive-otp-content h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ecomdrive-otp-content .otp-description {
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* Phone number display */
.otp-phone-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    direction: ltr;
}

.otp-phone-display svg {
    width: 18px;
    height: 18px;
    color: #16a34a;
}

/* OTP Input */
#otp-input {
    width: 100%;
    max-width: 200px;
    padding: 14px 16px;
    margin: 0 auto 12px;
    display: block;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 8px;
    transition: all 0.2s ease;
    outline: none;
    background: #f9fafb;
}

#otp-input:focus {
    border-color: #16a34a;
    background: white;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

#otp-input.error {
    border-color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

#otp-input::placeholder {
    letter-spacing: 2px;
    color: #9ca3af;
    font-size: 16px;
}

.otp-error-message {
    color: #dc2626;
    font-size: 13px;
    margin: 0 0 12px;
    display: none;
    font-weight: 500;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 8px;
}

/* Verify Button */
#verify-otp-btn {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 200px;
    margin: 8px auto 0;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

#verify-otp-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

#verify-otp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

/* Resend section */
.otp-resend {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

.otp-resend a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.otp-resend a:hover {
    text-decoration: underline;
}

/* Contact Info */
.otp-contact-info {
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #86efac;
    border-radius: 12px;
}

.otp-contact-info > p {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.otp-contact-info > p::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2316a34a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.otp-contact-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.otp-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    border: 1.5px solid #d1fae5;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.otp-contact-item:hover {
    border-color: #16a34a;
    background: #f0fdf4;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(22, 163, 74, 0.15);
}

.otp-contact-item .otp-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #16a34a;
}

.otp-contact-item span {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

/* Legacy loading (kept for compatibility) */
.ecomdrive-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ecomdrive-otp-content {
        width: calc(100% - 32px);
        padding: 24px 20px;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 12px;
    }

    .otp-icon-header {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    .otp-icon-header svg {
        width: 28px;
        height: 28px;
    }

    .ecomdrive-otp-content h3 {
        font-size: 20px;
    }

    .ecomdrive-otp-content .otp-description {
        font-size: 14px;
    }

    .otp-phone-display {
        font-size: 15px;
        padding: 6px 12px;
    }

    #otp-input {
        max-width: 180px;
        padding: 12px 14px;
        font-size: 22px;
        letter-spacing: 6px;
    }

    #verify-otp-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .otp-contact-items {
        flex-direction: column;
    }

    .otp-contact-item {
        justify-content: center;
    }
}

/* Small phones */
@media (max-width: 360px) {
    .ecomdrive-otp-content {
        width: calc(100% - 24px);
        padding: 20px 16px;
    }

    .otp-icon-header {
        width: 48px;
        height: 48px;
    }

    #otp-input {
        max-width: 160px;
        font-size: 20px;
        letter-spacing: 5px;
    }

    #verify-otp-btn {
        padding: 10px 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ecomdrive-otp-content {
        background: #1f2937;
    }

    .ecomdrive-otp-content h3 {
        color: #f9fafb;
    }

    .ecomdrive-otp-content .otp-description {
        color: #9ca3af;
    }

    .otp-phone-display {
        background: #374151;
        color: #f3f4f6;
    }

    #otp-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    #otp-input:focus {
        background: #1f2937;
        border-color: #16a34a;
    }

    .otp-error-message {
        background: #450a0a;
        color: #fca5a5;
    }

    .otp-contact-info {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        border-color: #10b981;
    }

    .otp-contact-info > p {
        color: #6ee7b7;
    }

    .otp-contact-info > p::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%236ee7b7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z'/%3E%3C/svg%3E");
    }

    .otp-contact-item {
        background: #1f2937;
        border-color: #374151;
    }

    .otp-contact-item:hover {
        background: #064e3b;
        border-color: #16a34a;
    }

    .otp-contact-item span {
        color: #e5e7eb;
    }
}
