/* ═══════════════════════════════════════════════════════
   Device Login — Cross-device authentication styles
   ═══════════════════════════════════════════════════════ */

/* ─── /link/ page ────────────────────────────────────── */
.dl-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.dl-card {
    width: min(520px, 100%);
    background: rgba(var(--card-rgb, 20, 24, 33), 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dl-card__header {
    text-align: center;
    margin-bottom: 28px;
}

.dl-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
    color: var(--accent, #667eea);
    margin-bottom: 16px;
}

.dl-card__icon-link {
    font-size: 18px;
    opacity: 0.5;
    animation: dl-pulse 2s ease-in-out infinite;
}

@keyframes dl-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.dl-card__title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.95);
}

.dl-card__subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* ─── Error state ────────────────────────────────────── */
.dl-error {
    text-align: center;
    padding: 20px 0;
}

.dl-error__icon {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.dl-error__text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ─── Code entry ─────────────────────────────────────── */
.dl-enter__desc {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.dl-enter__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dl-code-input {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.dl-code-char {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.95);
    outline: none;
    transition: all 0.2s;
    caret-color: var(--accent, #667eea);
}

.dl-code-char:focus {
    border-color: var(--accent, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.dl-code-char.dl-code-char--filled {
    border-color: var(--accent, #667eea);
    background: rgba(102, 126, 234, 0.08);
}

.dl-enter__error {
    text-align: center;
    color: #ef4444;
    font-size: 14px;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
}

/* ─── Buttons ────────────────────────────────────────── */
.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s;
    min-width: 160px;
}

.dl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dl-btn--primary {
    background: linear-gradient(135deg, var(--accent, #667eea) 0%, var(--accent-secondary, #764ba2) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.dl-btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
}

.dl-btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.dl-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.dl-btn--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.dl-btn--danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ─── Confirmation ───────────────────────────────────── */
.dl-confirm__info h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 800;
    color: var(--accent, #667eea);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dl-confirm__device {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.dl-confirm__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.dl-confirm__row + .dl-confirm__row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dl-confirm__label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.dl-confirm__value {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.dl-confirm__code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 2px;
    color: var(--accent, #667eea);
}

.dl-confirm__warning {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dl-confirm__actions {
    display: flex;
    gap: 12px;
}

.dl-confirm__result {
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    text-align: center;
    font-weight: 700;
}

.dl-confirm__result--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.dl-confirm__result--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════
   Modal (profile page)
   ═══════════════════════════════════════════════════════ */
.dl-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.dl-modal__content {
    position: relative;
    width: min(480px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(var(--card-rgb, 20, 24, 33), 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: dl-modal-in 0.3s ease-out;
}

@keyframes dl-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dl-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.dl-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dl-modal__header {
    text-align: center;
    margin-bottom: 24px;
}

.dl-modal__icon-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 28px;
    color: var(--accent, #667eea);
    margin-bottom: 16px;
}

.dl-modal__icon-arrow {
    font-size: 16px;
    opacity: 0.5;
    animation: dl-pulse 2s ease-in-out infinite;
}

.dl-modal__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.95);
}

.dl-modal__subtitle {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

/* Loading */
.dl-modal__loading {
    text-align: center;
    padding: 32px 0;
}

.dl-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent, #667eea);
    border-radius: 50%;
    animation: dl-spin 0.8s linear infinite;
}

@keyframes dl-spin {
    to { transform: rotate(360deg); }
}

.dl-modal__loading p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* QR Code */
.dl-modal__qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.dl-modal__qr-img {
    width: 260px;
    height: 260px;
    border-radius: 16px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Short code display */
.dl-modal__code-section {
    text-align: center;
    margin-bottom: 20px;
}

.dl-modal__code-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin-bottom: 12px;
}

.dl-modal__code-display {
    display: inline-flex;
    gap: 6px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--accent, #667eea);
    user-select: all;
    cursor: pointer;
}

.dl-modal__code-url {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.dl-modal__code-url strong {
    color: var(--accent, #667eea);
}

/* Timer */
.dl-modal__timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 16px;
}

.dl-modal__timer .fa-clock {
    color: var(--accent, #667eea);
}

/* Status */
.dl-modal__status {
    text-align: center;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.dl-modal__status--confirmed {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.dl-modal__status--confirmed p {
    color: #22c55e;
    font-weight: 700;
}

.dl-modal__status--confirmed .dl-modal__status-icon {
    font-size: 36px;
    color: #22c55e;
    margin-bottom: 8px;
}

.dl-modal__status--rejected {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.dl-modal__status--rejected p {
    color: #ef4444;
}

.dl-modal__status--expired {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.dl-modal__status--expired p {
    color: #ffc107;
}

/* Instructions */
.dl-modal__instructions {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}

.dl-modal__instructions h4 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
}

.dl-modal__instructions ol {
    margin: 0;
    padding: 0 0 0 20px;
}

.dl-modal__instructions li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin-bottom: 6px;
}

.dl-modal__instructions li strong {
    color: rgba(255, 255, 255, 0.8);
}

/* ═══════════════════════════════════════════════════════
   Login page — device login section
   ═══════════════════════════════════════════════════════ */
.dl-login-section {
    margin-top: 16px;
    text-align: center;
}

.dl-login-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent, #667eea);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.06);
    transition: all 0.2s;
}

.dl-login-link:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .dl-card {
        padding: 24px 18px;
    }

    .dl-code-char {
        width: 48px;
        height: 56px;
        font-size: 24px;
    }

    .dl-confirm__actions {
        flex-direction: column;
    }

    .dl-btn {
        min-width: auto;
        width: 100%;
    }

    .dl-modal__content {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .dl-modal__qr-img {
        width: 220px;
        height: 220px;
    }

    .dl-modal__code-display {
        font-size: 26px;
        letter-spacing: 4px;
        padding: 10px 18px;
    }
}
