﻿/* ==========================================================
   Two-Factor Authentication — Shared Styles
   Ntree.CloudManagementApp/wwwroot/css/twofactor.css
   ========================================================== */

/* ── Layout ── */
.twofa-wrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.twofa-card {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0,0,0,.10);
    padding: 40px 36px 32px;
}

/* ── Header icon ── */
.twofa-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 26px;
}

    .twofa-icon.blue {
        background: #e8f4ff;
    }

    .twofa-icon.yellow {
        background: #fff8e1;
    }

.twofa-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: #1a1f36;
}

.twofa-card .subtitle {
    text-align: center;
    color: #6b7280;
    font-size: .875rem;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ── OTP digit inputs (shared by Login + Setup) ── */
.otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-digit {
    width: 50px;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    color: #1a1f36;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    background: #f9fafb;
}

    .otp-digit:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 3px rgba(13,110,253,.15);
        background: #fff;
    }

    .otp-digit.is-filled {
        border-color: #0d6efd;
        background: #fff;
    }

    .otp-digit.is-invalid {
        border-color: #dc3545;
        box-shadow: 0 0 0 3px rgba(220,53,69,.12);
        animation: twofa-shake .35s ease;
    }

@keyframes twofa-shake {
    0%,100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ── Shared button ── */
.btn-twofa {
    width: 100%;
    padding: 12px;
    font-size: .95rem;
    font-weight: 600;
    border-radius: 8px;
}

/* ── Back link ── */
.twofa-back {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: .82rem;
    color: #6b7280;
    text-decoration: none;
}

    .twofa-back:hover {
        color: #0d6efd;
    }

/* ==========================================================
   LoginWith2FA specific
   ========================================================== */

/* Timer bar */
.timer-bar-wrap {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.timer-ring {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

    .timer-ring svg {
        transform: rotate(-90deg);
    }

    .timer-ring circle {
        fill: none;
        stroke-width: 3;
    }

.timer-track {
    stroke: #e5e7eb;
}

.timer-progress {
    stroke: #0d6efd;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke .4s;
}

.timer-ring.warn .timer-progress {
    stroke: #f59e0b;
}

.timer-ring.danger .timer-progress {
    stroke: #dc3545;
}

.timer-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: #374151;
}

.timer-code {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: .2em;
    color: #0d6efd;
    font-family: monospace;
    transition: color .3s;
}

    .timer-code.refreshing {
        color: #f59e0b;
    }

.timer-info {
    font-size: .75rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* Recovery toggle */
.recovery-toggle {
    text-align: center;
    margin-top: 14px;
    font-size: .82rem;
    color: #6b7280;
}

    .recovery-toggle a {
        color: #0d6efd;
        text-decoration: none;
    }

.recovery-section {
    display: none;
    margin-top: 16px;
}

    .recovery-section.show {
        display: block;
    }

/* ==========================================================
   Setup specific
   ========================================================== */

/* Progress steps */
.setup-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.setup-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
}

    .setup-step.active {
        color: #0d6efd;
    }

    .setup-step .num {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 2px solid currentColor;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .7rem;
    }

    .setup-step.active .num {
        background: #0d6efd;
        border-color: #0d6efd;
        color: #fff;
    }

.step-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
    margin: 0 8px;
    max-width: 40px;
}

/* QR box */
.qr-box {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

    .qr-box #qrCode {
        display: inline-block;
        background: white;
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 12px;
    }

/* Secret key */
.secret-key {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: .9rem;
    letter-spacing: .12em;
    color: #0d6efd;
    text-align: center;
    margin-bottom: 20px;
    word-break: break-all;
}

/* Or divider */
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
    font-size: .8rem;
    margin-bottom: 16px;
}

    .or-divider::before,
    .or-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #e5e7eb;
    }

/* Instruction steps */
.instruction-steps {
    padding: 0;
    list-style: none;
    margin-bottom: 20px;
}

    .instruction-steps li {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        padding: 8px 0;
        border-bottom: 1px solid #f3f4f6;
        font-size: .875rem;
        color: #374151;
    }

        .instruction-steps li:last-child {
            border-bottom: none;
        }

    .instruction-steps .step-badge {
        width: 22px;
        height: 22px;
        min-width: 22px;
        background: #0d6efd;
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .7rem;
        font-weight: 700;
        margin-top: 1px;
    }

/* ==========================================================
   RecoveryCodes specific
   ========================================================== */

.codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.code-item {
    font-family: monospace;
    font-size: .9rem;
    font-weight: 600;
    color: #1a1f36;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
    letter-spacing: .08em;
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .85rem;
    color: #92400e;
}

    .warning-box .icon {
        font-size: 1.1rem;
        margin-top: 1px;
        flex-shrink: 0;
    }

.copy-btn {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: .875rem;
}