/* ========================================================================
   OTP PAGES STYLES
   Two-factor authentication pages - extends login_base.html design
   ======================================================================== */

/* ===== METHOD SELECTION (otp_verify.html) ===== */
.method-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.method-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.method-option:hover {
    border-color: var(--business-primary, #060d47);
    box-shadow: 0 0 0 3px rgba(6, 13, 71, 0.08);
    transform: translateY(-1px);
}

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

.method-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--business-primary, #060d47);
    color: #ffffff;
}

.method-icon.totp {
    background: var(--business-primary, #060d47);
    color: #ffffff;
}

.method-icon.yubikey {
    background: var(--primary-color, #10a0da);
    color: #ffffff;
}

.method-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.method-name {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
}

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

.method-arrow {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

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

/* Back to Methods Button */
.back-to-methods {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.back-to-methods i {
    font-size: 0.75rem;
}

/* Hidden State */
.hidden {
    display: none !important;
}

/* ===== METHOD SELECTION PAGE (otp_method_select.html) ===== */
.otp-method-selection {
    width: 100%;
}

.method-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.method-option-btn {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.method-option-btn:hover {
    border-color: var(--business-primary, #060d47);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(6, 13, 71, 0.08);
    transform: translateY(-2px);
}

.method-option-btn .method-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;
    margin-bottom: 0.75rem;
}

.method-option-btn .method-icon i {
    font-size: 1.125rem;
    color: var(--business-primary, #060d47);
}

.method-option-btn h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.375rem 0;
}

.method-option-btn p {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.method-features {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.method-features li {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.method-features li i {
    color: #22c55e;
    font-size: 0.625rem;
}

/* ===== SETUP STEPS (otp_setup_totp.html, otp_setup_yubikey.html) ===== */
.otp-mandatory-setup {
    width: 100%;
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.setup-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--business-primary, #060d47);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.setup-step > p {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.setup-step > p:last-child {
    margin-bottom: 0;
}

/* Form within setup steps */
.setup-step .modern-login-form {
    margin-top: 0;
}

/* ===== QR CODE ===== */
.qr-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.qr-code {
    max-width: 180px;
    height: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.5rem;
}

.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: 12px;
    color: #9ca3af;
}

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

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

/* ===== MANUAL SETUP ===== */
.manual-setup {
    margin-top: 1rem;
}

.manual-setup details {
    background: #f9fafb;
    border-radius: 10px;
    padding: 0.875rem 1rem;
}

.manual-setup summary {
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--business-primary, #060d47);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manual-setup summary::-webkit-details-marker {
    display: none;
}

.manual-setup summary::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.625rem;
    transition: transform 0.2s ease;
}

.manual-setup details[open] summary::before {
    transform: rotate(90deg);
}

.manual-fields {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.manual-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.manual-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

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

.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;
}

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

/* ===== 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;
}

/* ===== INFO BOX ===== */
.otp-setup-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.04) 0%, rgba(16, 160, 218, 0.04) 100%);
    border: 1px solid rgba(6, 13, 71, 0.08);
    border-radius: 10px;
}

.otp-setup-info h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--business-primary, #060d47);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.otp-setup-info p {
    font-size: 0.8125rem;
    color: #4b5563;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.otp-setup-info p:last-child {
    margin-bottom: 0;
}

/* Simple info box variant (for password confirm) */
.otp-setup-info p i {
    color: var(--business-primary, #060d47);
    margin-right: 0.375rem;
}

/* ===== INPUT HINT ===== */
.input-hint {
    display: block;
    margin-top: 0.5rem;
    padding-left: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
}

/* ===== WIDE CONTAINER VARIANTS ===== */
@media (min-width: 768px) {
    /* Method options grid removed - using stacked list layout now */

    /* Setup pages - wider for two-column layout */
    .login-container.otp-wide {
        max-width: 720px;
    }

    /* Prevent vertical centering from clipping tall content */
    .login-page:has(.otp-wide) {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    /* TOTP Setup: Steps 1 & 2 side by side, Step 3 full width */
    .otp-setup-totp .setup-steps {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem 2rem;
    }

    .otp-setup-totp .setup-step {
        border-bottom: none;
        padding-bottom: 0;
    }

    .otp-setup-totp .setup-step:nth-child(2) {
        position: relative;
    }

    .otp-setup-totp .setup-step:nth-child(2)::before {
        content: '';
        position: absolute;
        left: -1rem;
        top: 0;
        bottom: 0;
        width: 1px;
        background: #e5e7eb;
    }

    .otp-setup-totp .setup-step:nth-child(3) {
        grid-column: 1 / -1;
        padding-top: 1.5rem;
        border-top: 1px solid #e5e7eb;
    }

    .otp-setup-totp .setup-step:nth-child(3)::before {
        display: none;
    }

    /* YubiKey Setup: Two columns */
    .otp-setup-yubikey .setup-steps {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .otp-setup-yubikey .setup-step {
        border-bottom: none;
        padding-bottom: 0;
    }

    .otp-setup-yubikey .setup-step:nth-child(2) {
        position: relative;
    }

    .otp-setup-yubikey .setup-step:nth-child(2)::before {
        content: '';
        position: absolute;
        left: -1rem;
        top: 0;
        bottom: 0;
        width: 1px;
        background: #e5e7eb;
    }

    /* Verify page method selection - wider */
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
    /* Method Selection */
    .method-selection {
        gap: 0.625rem;
    }

    .method-option {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
        min-height: 48px;
    }

    .method-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .method-name {
        font-size: 0.875rem;
    }

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

    /* Method Options (selection page) */
    .method-option-btn {
        padding: 1rem;
    }

    .method-option-btn .method-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.625rem;
    }

    .method-option-btn .method-icon i {
        font-size: 1rem;
    }

    .method-option-btn h3 {
        font-size: 0.9375rem;
    }

    .method-option-btn p {
        font-size: 0.75rem;
    }

    .method-features {
        margin-top: 0.625rem;
        gap: 0.25rem;
    }

    .method-features li {
        font-size: 0.6875rem;
    }

    /* Setup Steps */
    .setup-steps {
        gap: 1.25rem;
    }

    .setup-step {
        padding-bottom: 1.25rem;
    }

    .step-header {
        gap: 0.625rem;
        margin-bottom: 0.5rem;
    }

    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.8125rem;
    }

    .step-header h4 {
        font-size: 0.9375rem;
    }

    .setup-step > p {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
    }

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

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

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

    /* Manual Setup */
    .manual-setup details {
        padding: 0.75rem;
    }

    .manual-setup summary {
        font-size: 0.75rem;
    }

    .copy-field {
        padding: 0.5rem 0.625rem;
    }

    .copy-field code {
        font-size: 0.75rem;
    }

    /* Button Group - Stack vertically */
    .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;
    }

    /* Info Box */
    .otp-setup-info {
        margin-top: 1.25rem;
        padding: 0.875rem;
    }

    .otp-setup-info h5 {
        font-size: 0.8125rem;
    }

    .otp-setup-info p {
        font-size: 0.75rem;
    }

    /* Input Hint */
    .input-hint {
        font-size: 0.6875rem;
    }

    /* Back Button */
    .back-to-methods {
        font-size: 0.8125rem;
        padding: 0.375rem 0;
    }
}

@media (max-width: 360px) {
    .method-option {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .method-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9375rem;
    }

    .method-name {
        font-size: 0.8125rem;
    }

    .method-desc {
        font-size: 0.6875rem;
    }

    .method-option-btn {
        padding: 0.875rem;
    }

    .step-header h4 {
        font-size: 0.875rem;
    }

    .setup-step > p {
        font-size: 0.75rem;
    }

    .qr-code {
        max-width: 140px;
    }

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