﻿/* =========================================================================
   identity-pages.css
   Pagine Identity: ForgotPassword, ResetPassword, LoginWith2fa,
   EnableAuthenticator, Register e conferme.
   Colori da token --app-* (site.css). Sfondo/animazione: shared.css.
   ========================================================================= */

/* Variabili locali: solo le tinte che non esistono come token globali */
:root {
    --identity-header-bg: rgba(255, 255, 255, .65);
    --identity-step-bg: rgba(255, 255, 255, .75);
    --identity-tint-bg: rgba(13, 110, 253, .08);
    --identity-tint-border: rgba(13, 110, 253, .12);
    --identity-icon-bg: rgba(13, 110, 253, .10);
    --identity-icon-ok-bg: rgba(25, 135, 84, .12);
}

[data-bs-theme="dark"] {
    --identity-header-bg: rgba(255, 255, 255, .04);
    --identity-step-bg: rgba(255, 255, 255, .03);
    --identity-tint-bg: rgba(110, 168, 253, .10);
    --identity-tint-border: rgba(110, 168, 253, .22);
    --identity-icon-bg: rgba(110, 168, 253, .14);
    --identity-icon-ok-bg: rgba(25, 135, 84, .22);
}

body {
    overflow-x: hidden;
}

/* ---------- Wrapper ---------- */
.identity-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Register: sta sotto la navbar di _Layout */
.identity-wrapper--navbar {
    min-height: calc(100vh - 170px);
}

/* ---------- Card ---------- */
.identity-card {
    width: 100%;
    max-width: var(--identity-card-w, 520px);
    background: var(--app-surface-glass);
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.identity-card--w460 {
    --identity-card-w: 460px;
}

.identity-card--w520 {
    --identity-card-w: 520px;
}

.identity-card--w560 {
    --identity-card-w: 560px;
}

.identity-card--w760 {
    --identity-card-w: 760px;
}

.identity-card--w900 {
    --identity-card-w: 900px;
}

.identity-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--identity-header-bg);
}

.identity-body {
    padding: 2rem;
}

/* Pagine di conferma: contenuto centrato */
.identity-body--conferma {
    padding: 2.5rem 2rem;
    text-align: center;
}

/* ---------- Icona / titoli ---------- */
.identity-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--identity-icon-bg);
    color: var(--app-selected-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.identity-icon--grande {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    font-size: 2.3rem;
    margin: 0 auto 1.5rem auto;
}

.identity-icon--ok {
    background: var(--identity-icon-ok-bg);
    color: var(--app-success-text);
}

.identity-title {
    color: var(--app-text-strong);
    font-weight: 700;
}

.identity-subtitle {
    color: var(--app-text-muted);
}

.identity-text {
    color: var(--app-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* ---------- Box informativo ---------- */
.identity-info {
    background: var(--identity-tint-bg);
    border: 1px solid var(--identity-tint-border);
    border-radius: 1rem;
    padding: 1rem;
    color: var(--app-text-soft);
    font-size: .92rem;
}

.identity-uri {
    border-radius: .9rem;
    padding: .75rem .9rem;
    font-size: .78rem;
    word-break: break-all;
}

/* ---------- Link ---------- */
.identity-link {
    color: var(--app-selected-text);
    text-decoration: none;
    font-weight: 500;
}

    .identity-link:hover {
        text-decoration: underline;
    }

/* ---------- Form ---------- */
.identity-card .form-control,
.identity-card .form-select {
    border: 1px solid var(--app-border-input);
}

.identity-card .form-floating > .form-control,
.identity-card .form-floating > .form-select {
    border-radius: .9rem;
    min-height: 58px;
}

.identity-card .form-control:focus,
.identity-card .form-select:focus {
    border-color: var(--app-selected-text);
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12);
}

/* Variante verde (EnableAuthenticator) */
.identity-card--verde .form-control:focus {
    border-color: var(--app-success-text);
    box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .13);
}

/* Campo codice a 6 cifre (2FA / Authenticator) */
.identity-card .input-codice {
    border-radius: 1rem;
    min-height: 58px;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: .25rem;
}

.identity-card .validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

/* ---------- Bottoni ---------- */
.btn-identity {
    border-radius: 2rem;
    min-height: 52px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Setup Authenticator ---------- */
.identity-step {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: var(--identity-step-bg);
    padding: 1.25rem;
    height: 100%;
}

.identity-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: .5rem;
    font-size: .9rem;
}

/* Il QR deve restare su fondo chiaro in entrambi i temi, altrimenti non si legge */
.identity-qr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    min-height: 190px;
    padding: .8rem;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.identity-divider {
    border-left: 1px solid var(--app-border);
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .identity-wrapper {
        padding: 1rem;
    }

    .identity-header,
    .identity-body {
        padding: 1.25rem;
    }

    .identity-body--conferma {
        padding: 2rem 1.25rem;
    }

    .identity-divider {
        border-left: none;
    }

    .identity-qr {
        min-width: 170px;
        min-height: 170px;
    }
}
