/**
 * SecureMail Verify - Client Verification Stylesheet
 * Compatible with Nexus, Twenty-One, Six, Lagom, Desktop, and Mobile
 */

:root {
    --smv-primary: var(--nexus-primary, var(--bs-primary, var(--primary, #2563eb)));
    --smv-primary-hover: var(--nexus-primary-hover, var(--bs-primary-dark, #1d4ed8));
    --smv-radius: var(--nexus-border-radius, var(--bs-border-radius, 8px));
    --smv-bg: var(--nexus-card-bg, var(--bs-body-bg, #ffffff));
    --smv-text: var(--nexus-text-color, var(--bs-body-color, #1e293b));
    --smv-text-muted: var(--nexus-text-muted, var(--bs-secondary-color, #64748b));
    --smv-border: var(--nexus-border-color, var(--bs-border-color, #cbd5e1));
    --smv-font-family: var(--nexus-font-sans, var(--bs-body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif));
}

@media (prefers-color-scheme: dark) {
    [data-theme="dark"] .smv-modal-card,
    [data-bs-theme="dark"] .smv-modal-card,
    .theme-dark .smv-modal-card,
    .dark .smv-modal-card {
        --smv-bg: var(--nexus-card-bg, #1e293b);
        --smv-text: var(--nexus-text-color, #f8fafc);
        --smv-text-muted: var(--nexus-text-muted, #94a3b8);
        --smv-border: var(--nexus-border-color, #334155);
    }
}

[data-theme="dark"] .smv-modal-card,
[data-bs-theme="dark"] .smv-modal-card,
.theme-dark .smv-modal-card,
.dark .smv-modal-card {
    --smv-bg: var(--nexus-card-bg, #1e293b);
    --smv-text: var(--nexus-text-color, #f8fafc);
    --smv-text-muted: var(--nexus-text-muted, #94a3b8);
    --smv-border: var(--nexus-border-color, #334155);
}

[data-theme="dark"] .smv-otp-box,
[data-bs-theme="dark"] .smv-otp-box,
.theme-dark .smv-otp-box,
.dark .smv-otp-box {
    background-color: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

[data-theme="dark"] .smv-otp-box.active,
[data-bs-theme="dark"] .smv-otp-box.active,
.theme-dark .smv-otp-box.active,
.dark .smv-otp-box.active {
    background-color: #1e293b;
    border-color: var(--smv-primary);
}

.smv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    padding: 16px;
    animation: smvFadeIn 0.2s ease-out forwards;
}

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

.smv-modal-card {
    font-family: var(--smv-font-family);
    background: var(--smv-bg);
    color: var(--smv-text);
    border-radius: var(--smv-radius);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    padding: 32px 28px;
    box-sizing: border-box;
    animation: smvScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes smvScaleUp {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.smv-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--smv-text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.smv-modal-close:hover {
    color: var(--smv-text);
}

.smv-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: var(--smv-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.smv-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--smv-text);
}

.smv-modal-subtitle {
    font-size: 14px;
    color: var(--smv-text-muted);
    margin: 0 0 20px;
    line-height: 1.4;
}

.smv-modal-subtitle strong {
    color: var(--smv-text);
    word-break: break-all;
}

.smv-alert {
    padding: 10px 14px;
    border-radius: var(--smv-radius);
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.4;
    text-align: left;
}

.smv-alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.smv-alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* OTP Boxes Container */
.smv-otp-container {
    position: relative;
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.smv-otp-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.smv-otp-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.smv-otp-box {
    width: 46px;
    height: 56px;
    border: 2px solid var(--smv-border);
    border-radius: var(--smv-radius);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--smv-text);
    background-color: #f8fafc;
    transition: all 0.15s ease;
}

.smv-otp-box.active {
    border-color: var(--smv-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.smv-otp-box.filled {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.smv-timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--smv-text-muted);
    margin-bottom: 22px;
}

.smv-btn-link {
    background: none;
    border: none;
    color: var(--smv-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.smv-btn-link:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    text-decoration: none;
}

.smv-link-inline {
    margin-left: 6px;
    font-weight: 700;
    text-decoration: underline;
    display: inline;
}

.smv-email-helper {
    margin-top: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.smv-helper-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--smv-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.smv-helper-link:hover {
    color: var(--smv-primary-hover);
}

.smv-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.smv-btn-primary {
    width: 100%;
    background-color: var(--smv-primary);
    color: #ffffff;
    border: none;
    padding: 13px 20px;
    border-radius: var(--smv-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.smv-btn-primary:hover {
    background-color: var(--smv-primary-hover);
}

.smv-btn-primary:active {
    transform: scale(0.98);
}

.smv-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: smvSpin 0.7s linear infinite;
}

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

.smv-link-muted {
    font-size: 13px;
    color: var(--smv-text-muted);
    text-decoration: none;
}

.smv-link-muted:hover {
    color: var(--smv-text);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .smv-modal-card {
        padding: 24px 18px;
    }
    .smv-otp-box {
        width: 38px;
        height: 48px;
        font-size: 20px;
    }
    .smv-otp-boxes {
        gap: 6px;
    }
}
