/* ============================================================
   File: assets/css/auth.css — v1
   HACCP TraceApp — Pagine di autenticazione
   ============================================================ */

:root {
    --auth-font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --auth-bg: linear-gradient(135deg, #1f2937 0%, #0f766e 100%);
    --auth-card-max: 460px;
    --auth-card-max-wide: 620px;
}

html, body {
    font-family: var(--auth-font-family);
}

body.layout-auth {
    background: var(--auth-bg);
    min-height: 100vh;
}

.auth-wrapper {
    max-width: var(--auth-card-max);
    margin: 0 auto;
    width: 100%;
}

.auth-wrapper.wide {
    max-width: var(--auth-card-max-wide);
}

.auth-card {
    border-radius: 1rem;
    background-color: #fff;
}

.auth-brand {
    letter-spacing: .5px;
}

.auth-footer a {
    color: rgba(255, 255, 255, .85);
}

.auth-footer {
    color: rgba(255, 255, 255, .75);
}

/* ── Toggle visibilità password ─────────────────────────── */
.password-field {
    position: relative;
}

.password-field .btn-toggle {
    position: absolute;
    right: .25rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #6c757d;
    padding: .25rem .5rem;
}

.password-field .btn-toggle:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.password-field .form-control {
    padding-right: 2.5rem;
}

/* ── Indicatore forza password ──────────────────────────── */
.strength-meter {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    overflow: hidden;
}

.strength-meter .bar {
    height: 100%;
    width: 0%;
    transition: width .2s ease, background-color .2s ease;
}

.strength-meter[data-level="1"] .bar { width: 25%;  background: #dc3545; }
.strength-meter[data-level="2"] .bar { width: 50%;  background: #fd7e14; }
.strength-meter[data-level="3"] .bar { width: 75%;  background: #ffc107; }
.strength-meter[data-level="4"] .bar { width: 100%; background: #198754; }

/* ── PIN keypad (login operatore) ───────────────────────── */
.pin-display {
    letter-spacing: .75rem;
    font-variant-numeric: tabular-nums;
    font-size: 1.75rem;
    font-weight: 600;
    min-height: 3rem;
    border: 1px solid #ced4da;
    border-radius: .5rem;
    background-color: #f8f9fa;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
}

.pin-keypad .btn {
    aspect-ratio: 1 / 1;
    font-size: 1.25rem;
    font-weight: 600;
}

/* ── Login split layout ─────────────────────────────────── */

body.layout-login {
    display:        flex;
    flex-direction: column;
    min-height:     100vh;
    font-family:    var(--auth-font-family);
    background:     #f1f5f9;
}

.login-split {
    flex:    1;
    display: flex;
}

/* Pannello branding (sx) */
.login-panel-brand {
    width:           50%;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    background:      linear-gradient(160deg, #1f2937 0%, #134e4a 60%, #0f766e 100%);
    padding:         3rem;
    position:        relative;
    overflow:        hidden;
}

.login-brand-glow {
    position:       absolute;
    width:          500px;
    height:         500px;
    background:     radial-gradient(circle, rgba(20, 184, 166, .15) 0%, transparent 70%);
    border-radius:  50%;
    top:            50%;
    left:           50%;
    transform:      translate(-50%, -50%);
    pointer-events: none;
}

.login-brand-inner {
    position:   relative;
    z-index:    1;
    text-align: center;
}

.login-brand-logo {
    display:       block;
    margin:        0 auto 1.5rem;
    border-radius: .75rem;
}

.login-brand-name {
    font-size:      3rem;
    font-weight:    700;
    color:          #ffffff;
    letter-spacing: -.03em;
    line-height:    1;
    margin-bottom:  .75rem;
}

.login-brand-slogan {
    font-size:    1.0625rem;
    color:        rgba(255, 255, 255, .6);
    line-height:  1.65;
    max-width:    300px;
    margin:       0 auto 2.25rem;
}

.login-brand-features {
    list-style:     none;
    padding:        0;
    margin:         0;
    display:        flex;
    flex-direction: column;
    gap:            .75rem;
    text-align:     left;
}

.login-brand-feature {
    display:     flex;
    align-items: center;
    gap:         .625rem;
    color:       rgba(255, 255, 255, .75);
    font-size:   .9375rem;
}

.login-brand-feature i {
    color:       #2dd4bf;
    font-size:   1.0625rem;
    flex-shrink: 0;
}

/* Pannello form (dx) */
.login-panel-form {
    width:           50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         3rem 2rem;
    background:      #f1f5f9;
}

.login-card {
    background:    #ffffff;
    border-radius: 1rem;
    box-shadow:    0 4px 24px rgba(0, 0, 0, .08);
    padding:       2.5rem;
    width:         100%;
    max-width:     420px;
}

.login-logo {
    text-align:    center;
    margin-bottom: 2rem;
}

.login-card-title {
    font-size:      1.625rem;
    font-weight:    700;
    color:          #111827;
    letter-spacing: -.02em;
}

.login-tagline {
    font-size:  .875rem;
    color:      #94a3b8;
    margin-top: .25rem;
}

/* Link sotto il form */
.login-links {
    margin-top:     1.25rem;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            .5rem;
    font-size:      .875rem;
    color:          #64748b;
}

.login-links a {
    color:           #0d9488;
    text-decoration: none;
    font-weight:     500;
}

.login-links a:hover { text-decoration: underline; }

/* Variante card larga (registrazione) */
.login-card--wide {
    max-width: 560px;
}

/* Icona successo (email inviata) */
.login-success-icon {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           72px;
    height:          72px;
    border-radius:   50%;
    background:      rgba(20, 184, 166, .12);
    color:           #0d9488;
    font-size:       2.25rem;
}

/* Footer */
.login-footer {
    background:  #1f2937;
    border-top:  1px solid rgba(255, 255, 255, .07);
    padding:     .875rem 1.5rem;
}

.lf-row {
    display:         flex;
    align-items:     center;
    justify-content: center;
    flex-wrap:       wrap;
    gap:             .5rem .75rem;
    font-size:       .8125rem;
    color:           rgba(255, 255, 255, .55);
}

.lf-sep { opacity: .4; }

.lf-link {
    color:           rgba(255, 255, 255, .65);
    text-decoration: none;
}

.lf-link:hover { color: #ffffff; text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
    .login-split       { flex-direction: column; }
    .login-panel-brand { width: 100%; min-height: 220px; padding: 2rem 1.5rem; }
    .login-brand-name  { font-size: 2.25rem; }
    .login-brand-features { display: none; }
    .login-panel-form  { width: 100%; padding: 2rem 1.25rem; }
}

/* ── Operatori grid ─────────────────────────────────────── */
.operator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .75rem;
}

.operator-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem .5rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    background-color: #fff;
    color: #212529;
    text-decoration: none;
    transition: transform .1s ease, box-shadow .15s ease;
    min-height: 110px;
}

.operator-tile:hover,
.operator-tile:focus {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1);
    color: #212529;
    outline: none;
}

.operator-tile.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .2);
}

.operator-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: .4rem;
}
