/* ========================================================================
   OTP PAGES REDESIGN
   Modern two-factor authentication page styles
   Minimal elegant design with subtle animations
   ======================================================================== */

/* ===== SECURITY HEADER ===== */
.otp-security-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.otp-security-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.08) 0%, rgba(16, 160, 218, 0.12) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.otp-security-icon i {
    font-size: 2rem;
    color: var(--business-primary, #060d47);
    z-index: 1;
}

.otp-security-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(16, 160, 218, 0.25);
    animation: securityPulse 2.5s ease-in-out infinite;
}

@keyframes securityPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* Verification variant */
.otp-security-icon--verify {
    background: linear-gradient(135deg, rgba(16, 160, 218, 0.1) 0%, rgba(6, 13, 71, 0.08) 100%);
}

/* ===== MINIMAL ELEGANT METHOD CARDS ===== */
.otp-method-cards {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    width: 100%;
}

.otp-method-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
}

.otp-method-card:hover {
    border-color: var(--business-primary, #060d47);
    box-shadow: 0 4px 16px rgba(6, 13, 71, 0.1);
    transform: translateY(-2px);
}

.otp-method-card:focus {
    outline: none;
    border-color: var(--business-primary, #060d47);
    box-shadow: 0 0 0 3px rgba(6, 13, 71, 0.1);
}

.otp-method-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(6, 13, 71, 0.08);
}

.otp-method-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.otp-method-icon i {
    font-size: 1.375rem;
    transition: transform 0.25s ease;
}

.otp-method-icon--totp {
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.08) 0%, rgba(6, 13, 71, 0.04) 100%);
    color: var(--business-primary, #060d47);
}

.otp-method-icon--yubikey {
    background: linear-gradient(135deg, rgba(16, 160, 218, 0.12) 0%, rgba(16, 160, 218, 0.06) 100%);
    color: var(--business-secondary, #10a0da);
}

.otp-method-card:hover .otp-method-icon {
    transform: scale(1.05);
}

.otp-method-card:hover .otp-method-icon i {
    transform: scale(1.1);
}

.otp-method-content {
    flex: 1;
    min-width: 0;
}

.otp-method-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.otp-method-desc {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.otp-method-arrow {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.otp-method-card:hover .otp-method-arrow {
    color: var(--business-primary, #060d47);
    transform: translateX(4px);
}

/* ===== WIZARD PROGRESS INDICATOR ===== */
.otp-wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.otp-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.otp-wizard-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9ca3af;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.otp-wizard-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* Active step */
.otp-wizard-step.active .otp-wizard-dot {
    border-color: var(--business-primary, #060d47);
    background: var(--business-primary, #060d47);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(6, 13, 71, 0.3);
}

.otp-wizard-step.active .otp-wizard-label {
    color: var(--business-primary, #060d47);
    font-weight: 600;
}

/* Completed step */
.otp-wizard-step.completed .otp-wizard-dot {
    border-color: var(--business-success, #10b981);
    background: var(--business-success, #10b981);
    color: #ffffff;
}

.otp-wizard-step.completed .otp-wizard-dot span {
    display: none;
}

.otp-wizard-step.completed .otp-wizard-dot::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.875rem;
}

.otp-wizard-step.completed .otp-wizard-label {
    color: var(--business-success, #10b981);
}

/* Connector line */
.otp-wizard-connector {
    width: 48px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s ease;
}

.otp-wizard-step.completed + .otp-wizard-connector,
.otp-wizard-connector.completed {
    background: var(--business-success, #10b981);
}

/* ===== APP LIST (for TOTP setup) ===== */
.otp-app-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.otp-app-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
}

.otp-app-item i {
    font-size: 1.125rem;
    color: var(--business-primary, #060d47);
    width: 1.5rem;
    text-align: center;
}

/* ===== SETUP WIZARD CONTAINER ===== */
.otp-setup-wizard {
    width: 100%;
}

.otp-setup-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.otp-setup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.otp-setup-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.otp-setup-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.08) 0%, rgba(16, 160, 218, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.otp-setup-section-icon i {
    font-size: 1rem;
    color: var(--business-primary, #060d47);
}

.otp-setup-section-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.otp-setup-section-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ===== QR CODE DISPLAY ===== */
.otp-qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.25rem 0;
}

.otp-qr-frame {
    position: relative;
    padding: 0.875rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    display: inline-block;
}

/* Corner accents */
.otp-qr-frame::before,
.otp-qr-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--business-primary, #060d47);
    pointer-events: none;
}

.otp-qr-frame::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 16px;
}

.otp-qr-frame::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 16px;
}

.otp-qr-code {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 8px;
}

.otp-qr-placeholder {
    width: 180px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #9ca3af;
}

.otp-qr-placeholder i {
    font-size: 2.5rem;
}

.otp-qr-placeholder span {
    font-size: 0.75rem;
}

.otp-qr-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.otp-qr-hint i {
    color: var(--business-secondary, #10a0da);
    animation: phoneScan 2s ease-in-out infinite;
}

@keyframes phoneScan {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ===== MANUAL ENTRY TOGGLE ===== */
.otp-manual-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--business-primary, #060d47);
    cursor: pointer;
    transition: all 0.2s ease;
}

.otp-manual-toggle:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.otp-manual-toggle i {
    font-size: 0.875rem;
}

.otp-manual-toggle .fa-chevron-down {
    transition: transform 0.2s ease;
}

.otp-manual-toggle.expanded .fa-chevron-down {
    transform: rotate(180deg);
}

.otp-manual-content {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
}

.otp-manual-field {
    margin-bottom: 0.75rem;
}

.otp-manual-field:last-child {
    margin-bottom: 0;
}

.otp-manual-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.otp-copy-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
}

.otp-copy-field code {
    flex: 1;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8125rem;
    color: #111827;
    word-break: break-all;
}

.otp-copy-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-copy-btn:hover {
    color: var(--business-primary, #060d47);
    background: #f3f4f6;
}

.otp-copy-btn.copied {
    color: var(--business-success, #10b981);
}

/* ===== SEGMENTED CODE INPUT ===== */
.otp-code-input {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.otp-code-box {
    width: 48px;
    height: 56px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
    text-align: center;
    color: #111827;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.otp-code-box::-webkit-outer-spin-button,
.otp-code-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-code-box:focus {
    outline: none;
    border-color: var(--business-primary, #060d47);
    box-shadow: 0 0 0 3px rgba(6, 13, 71, 0.1);
}

.otp-code-box.filled {
    border-color: var(--business-primary, #060d47);
    background: rgba(6, 13, 71, 0.02);
}

.otp-code-box.error {
    border-color: var(--business-danger, #ef4444);
    animation: codeShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.otp-code-box.success {
    border-color: var(--business-success, #10b981);
    background: rgba(16, 185, 129, 0.05);
}

@keyframes codeShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Hidden actual form input */
.otp-code-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ===== YUBIKEY SPECIFIC ===== */
.otp-yubikey-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.5rem 0;
}

.otp-yubikey-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 160, 218, 0.1) 0%, rgba(6, 13, 71, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.otp-yubikey-icon i {
    font-size: 1.75rem;
    color: var(--business-secondary, #10a0da);
}

.otp-yubikey-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(16, 160, 218, 0.3);
    animation: touchPulse 1.5s ease-in-out infinite;
}

@keyframes touchPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.otp-yubikey-hint {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.otp-yubikey-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.otp-yubikey-status i {
    font-size: 0.75rem;
}

.otp-yubikey-status.detecting {
    color: var(--business-secondary, #10a0da);
}

.otp-yubikey-status.success {
    color: var(--business-success, #10b981);
}

/* ===== INFO CARD ===== */
.otp-info-card {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.03) 0%, rgba(16, 160, 218, 0.03) 100%);
    border: 1px solid rgba(6, 13, 71, 0.08);
    border-radius: 12px;
}

.otp-info-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(6, 13, 71, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.otp-info-card-icon i {
    font-size: 0.875rem;
    color: var(--business-primary, #060d47);
}

.otp-info-card-content h5 {
    margin: 0 0 0.375rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.otp-info-card-content p {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ===== SECURITY NOTE ===== */
.otp-security-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.875rem;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

.otp-security-note i {
    color: var(--business-secondary, #10a0da);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* ===== CONFIRM CONTEXT ===== */
.otp-confirm-context {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.05) 0%, rgba(16, 160, 218, 0.05) 100%);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
}

.otp-confirm-context i {
    color: var(--business-primary, #060d47);
}

/* ===== BACK BUTTON (updated style) ===== */
.otp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.otp-back-link:hover {
    color: var(--business-primary, #060d47);
}

.otp-back-link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.otp-back-link:hover i {
    transform: translateX(-3px);
}

/* ===== HELP SECTION ===== */
.otp-help-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.otp-help-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 0;
    background: none;
    border: none;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

.otp-help-toggle:hover {
    color: var(--business-primary, #060d47);
}

.otp-help-toggle i:first-child {
    color: var(--business-secondary, #10a0da);
}

.otp-help-toggle .fa-chevron-down {
    margin-left: auto;
    font-size: 0.625rem;
    transition: transform 0.2s ease;
}

.otp-help-toggle.expanded .fa-chevron-down {
    transform: rotate(180deg);
}

.otp-help-content {
    padding: 0.75rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.6;
}

/* ===== WIDE CONTAINER (for setup pages) ===== */
@media (min-width: 768px) {
    .login-container.otp-wide {
        max-width: 560px;
    }

    .otp-setup-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .otp-setup-grid .otp-setup-section {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .otp-setup-grid .otp-setup-section:first-child {
        padding-right: 1.5rem;
        border-right: 1px solid #e5e7eb;
    }

    .otp-setup-full {
        grid-column: 1 / -1;
        padding-top: 1.5rem;
        border-top: 1px solid #e5e7eb;
    }
}

/* ===== BUTTON GROUP ===== */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.button-group .modern-btn {
    flex: 1;
}

.otp-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 48px;
}

.otp-back-btn:hover {
    background: #e5e7eb;
    color: #111827;
    border-color: #9ca3af;
}

.otp-back-btn i {
    font-size: 0.875rem;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
    /* Button Group - Stack vertically on mobile */
    .button-group {
        flex-direction: column-reverse;
        gap: 0.625rem;
    }

    .button-group .otp-back-btn,
    .button-group .modern-btn {
        width: 100%;
        flex: none;
    }

    .otp-back-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .otp-security-icon {
        width: 68px;
        height: 68px;
    }

    .otp-security-icon i {
        font-size: 1.75rem;
    }

    .otp-method-card {
        padding: 1rem;
        gap: 0.875rem;
    }

    .otp-method-icon {
        width: 44px;
        height: 44px;
    }

    .otp-method-icon i {
        font-size: 1.125rem;
    }

    .otp-method-name {
        font-size: 0.9375rem;
    }

    .otp-method-desc {
        font-size: 0.75rem;
    }

    /* Wizard progress */
    .otp-wizard-progress {
        padding: 0;
    }

    .otp-wizard-dot {
        width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    .otp-wizard-label {
        font-size: 0.6875rem;
    }

    .otp-wizard-connector {
        width: 32px;
    }

    /* QR Code */
    .otp-qr-code {
        width: 160px;
        height: 160px;
    }

    .otp-qr-placeholder {
        width: 160px;
        height: 160px;
    }

    /* Code input */
    .otp-code-input {
        gap: 0.375rem;
    }

    .otp-code-box {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Info card */
    .otp-info-card {
        flex-direction: column;
        gap: 0.75rem;
    }

    .otp-info-card-icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 360px) {
    .otp-security-icon {
        width: 60px;
        height: 60px;
    }

    .otp-security-icon i {
        font-size: 1.5rem;
    }

    .otp-method-card {
        padding: 0.875rem;
    }

    .otp-method-icon {
        width: 40px;
        height: 40px;
    }

    .otp-code-input {
        gap: 0.25rem;
    }

    .otp-code-box {
        width: 38px;
        height: 46px;
        font-size: 1.125rem;
        border-radius: 8px;
    }

    .otp-qr-code,
    .otp-qr-placeholder {
        width: 140px;
        height: 140px;
    }

    .otp-qr-frame::before,
    .otp-qr-frame::after {
        width: 16px;
        height: 16px;
    }
}
