/*
 * WTR Cloud — Slate Ice Theme
 * Palette: theme.py (EasyTime CE / Synergy Solution)
 * Versione: 2026.1
 * Accessibilità: WCAG AA — Legge Stanca 04/2004
 */

/* ── Skip navigation — accessibilità tastiera ──────────────────────────── */
.wtr-skip-link {
    position: absolute;
    top: -100%;
    left: 8px;
    padding: 8px 16px;
    background: #1A72E8;
    color: #fff;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    text-decoration: none;
    z-index: 9999;
    transition: top .15s;
}
.wtr-skip-link:focus { top: 0; }

/* ── CSS Custom Properties (Palette Slate Ice) ─────────────────────────── */
:root {
    --wtr-bg:          #F2F4F7;
    --wtr-surface:     #FFFFFF;
    --wtr-border:      #DFE3EA;
    --wtr-chip:        #EBEEF2;
    --wtr-entry-bg:    #FFFFFF;
    --wtr-fg:          #0F172A;
    --wtr-muted:       #546077;
    --wtr-accent:      #1A72E8;
    --wtr-accent-soft: #E7ECFC;
    --wtr-accent-dark: #1560C8;
    --wtr-success:     #0A6E49;
    --wtr-success-soft:#E2FBF1;
    --wtr-danger:      #B91C1C;
    --wtr-danger-soft: #FCE8EA;
    --wtr-warning:     #7A5209;
    --wtr-warning-soft:#FCF0DD;
    --wtr-font:        'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', sans-serif;
    --wtr-radius:      8px;
    --wtr-radius-lg:   14px;
    --wtr-shadow:      0 1px 3px rgba(15,23,42,.07), 0 4px 16px rgba(15,23,42,.05);
    --wtr-shadow-lg:   0 4px 12px rgba(15,23,42,.09), 0 16px 48px rgba(15,23,42,.09);
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--wtr-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--wtr-fg);
    background: var(--wtr-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Layout pagina ─────────────────────────────────────────────────────── */
.wtr-page {
    display: flex;
    min-height: 100vh;
}

/* ── Pannello sinistro — branding ──────────────────────────────────────── */
.wtr-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42%;
    min-width: 320px;
    background: linear-gradient(145deg, #1258B2 0%, #1A72E8 55%, #4C96F8 100%);
    color: #FFFFFF;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

/* Cerchi decorativi di sfondo */
.wtr-brand::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 320px; height: 320px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
    pointer-events: none;
}
.wtr-brand::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -60px;
    width: 360px; height: 360px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
    pointer-events: none;
}

.wtr-brand__inner { position: relative; z-index: 1; max-width: 340px; }

/* Logo mark */
.wtr-brand__logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
}
.wtr-brand__logo-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,.16);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}
.wtr-brand__logo-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px;
}
.wtr-brand__logo-text span {
    display: block;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .5px;
    opacity: .75;
    margin-top: 2px;
}

/* Il motto del prodotto: «La presenza si rileva, la sicurezza si verifica.»
   Sta fra il marchio e la descrizione della schermata, e si distingue da
   entrambi — corsivo, un filetto a sinistra — perché non è né il nome né
   un'istruzione: è la frase che dice la differenza fra le due anime del
   programma. Va sempre sotto il nome per esteso, mai da sola. */
.wtr-brand__motto {
    font-size: 15px;
    font-style: italic;
    font-weight: 300;
    line-height: 1.5;
    opacity: .82;
    border-left: 3px solid currentColor;
    padding-left: 12px;
    margin: 0 0 22px;
}

.wtr-brand__tagline {
    font-size: 17px;
    font-weight: 300;
    line-height: 1.6;
    opacity: .9;
    margin-bottom: 44px;
}

.wtr-brand__features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    padding-left: 0;
}
.wtr-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: .85;
}
.wtr-feature .fa { font-size: 15px; color: rgba(255,255,255,.9); flex-shrink: 0; }

/* ── Pannello destro — form di accesso ─────────────────────────────────── */
.wtr-login-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    overflow-y: auto;
}

/* Card */
.wtr-login-card {
    width: 100%;
    max-width: 428px;
    background: var(--wtr-surface);
    border-radius: var(--wtr-radius-lg);
    box-shadow: var(--wtr-shadow-lg);
    border: 1px solid var(--wtr-border);
    overflow: hidden;
}

/* Header card */
.wtr-login-card__header {
    padding: 40px 40px 28px;
    text-align: center;
    border-bottom: 1px solid var(--wtr-border);
    background: var(--wtr-bg);
}
.wtr-login-card__icon {
    width: 68px; height: 68px;
    background: var(--wtr-accent-soft);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.wtr-login-card__icon .fa {
    font-size: 30px;
    color: var(--wtr-accent);
}
.wtr-login-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--wtr-fg);
    margin-bottom: 6px;
    letter-spacing: -.3px;
}
.wtr-login-card__subtitle {
    font-size: 14px;
    color: var(--wtr-muted);
}

/* Body card */
.wtr-login-card__body {
    padding: 32px 40px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Footer card */
.wtr-login-card__footer {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--wtr-border);
    text-align: center;
}

/* ── Alert ─────────────────────────────────────────────────────────────── */
.wtr-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--wtr-radius);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0 40px;
}
.wtr-alert--danger {
    background: var(--wtr-danger-soft);
    color: var(--wtr-danger);
    border: 1px solid #F2C0C0;
}
.wtr-alert .fa { margin-top: 2px; flex-shrink: 0; }
.wtr-alert__close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    margin-left: auto;
    padding: 0 0 0 8px;
    opacity: .65;
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
    transition: opacity .15s;
}
.wtr-alert__close:hover { opacity: 1; }
.wtr-alert__close:focus-visible { outline: 2px solid var(--wtr-danger); border-radius: 3px; }

/* ── Campi di input ────────────────────────────────────────────────────── */
.wtr-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.wtr-field__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--wtr-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.wtr-field__label .fa { color: var(--wtr-accent); font-size: 12px; }

.wtr-field__input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--wtr-border);
    border-radius: var(--wtr-radius);
    background: var(--wtr-entry-bg);
    color: var(--wtr-fg);
    font-family: var(--wtr-font);
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.wtr-field__input:focus {
    border-color: var(--wtr-accent);
    box-shadow: 0 0 0 3px var(--wtr-accent-soft);
}
.wtr-field__input::placeholder { color: #BEC5CF; }

/* Rimuove frecce spinner su input number */
input[type=number].wtr-field__input { -moz-appearance: textfield; appearance: textfield; }
input[type=number].wtr-field__input::-webkit-outer-spin-button,
input[type=number].wtr-field__input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Wrapper con toggle visibilità password */
.wtr-field__pwd-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.wtr-field__pwd-wrapper .wtr-field__input { padding-right: 44px; }
.wtr-field__pwd-toggle {
    position: absolute;
    right: 13px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--wtr-muted);
    font-size: 15px;
    padding: 4px;
    line-height: 1;
    transition: color .15s;
}
.wtr-field__pwd-toggle:hover { color: var(--wtr-accent); }
.wtr-field__pwd-toggle:focus-visible { outline: 2px solid var(--wtr-accent); border-radius: 4px; }

/* ── Blocco attivazione licenza ────────────────────────────────────────── */
.wtr-license-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--wtr-warning-soft);
    border: 1px solid #E5CC9A;
    border-radius: var(--wtr-radius);
}
.wtr-license-block .wtr-field__label { color: var(--wtr-warning); }
.wtr-license-block .wtr-field__label .fa { color: var(--wtr-warning); }

/* ── Pulsanti ───────────────────────────────────────────────────────────── */
.wtr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--wtr-radius);
    font-family: var(--wtr-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
    letter-spacing: .01em;
    white-space: nowrap;
}
.wtr-btn:focus-visible {
    outline: 2px solid var(--wtr-accent);
    outline-offset: 2px;
}
.wtr-btn:disabled, .wtr-btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

/* Primario */
.wtr-btn--primary {
    background: var(--wtr-accent);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(52,87,213,.22);
}
.wtr-btn--primary:hover {
    background: var(--wtr-accent-dark);
    box-shadow: 0 4px 14px rgba(52,87,213,.32);
}
.wtr-btn--primary:active { transform: translateY(1px); box-shadow: none; }

/* Successo */
.wtr-btn--success {
    background: var(--wtr-success);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(10,110,73,.18);
}
.wtr-btn--success:hover { background: #085d3d; }
.wtr-btn--success:active { transform: translateY(1px); }

/* Modificatori */
.wtr-btn--full { width: 100%; }
.wtr-btn--lg   { padding: 14px 20px; font-size: 15px; }

/* ── Link ───────────────────────────────────────────────────────────────── */
.wtr-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--wtr-accent);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}
.wtr-link:hover { color: var(--wtr-accent-dark); text-decoration: underline; }
.wtr-link:focus-visible { outline: 2px solid var(--wtr-accent); border-radius: 4px; }

/* ── Copyright ──────────────────────────────────────────────────────────── */
.wtr-copyright {
    margin-top: 28px;
    font-size: 12px;
    color: var(--wtr-muted);
    text-align: center;
    opacity: .7;
    letter-spacing: .01em;
}

/* ── Messaggi di sistema — divMessaggi (impostati da Constanti.cs) ──────── */
.wtr-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--wtr-radius);
    font-size: 13.5px;
    line-height: 1.5;
    border: 1px solid transparent;
    margin: 0;
}
.wtr-msg--success { background: var(--wtr-success-soft); color: var(--wtr-success); border-color: #A7F3D0; }
.wtr-msg--error   { background: var(--wtr-danger-soft);  color: var(--wtr-danger);  border-color: #FCA5A5; }
.wtr-msg--warning { background: var(--wtr-warning-soft); color: var(--wtr-warning); border-color: #FDE68A; }
.wtr-msg .fa { margin-top: 2px; flex-shrink: 0; }
.wtr-msg .wtr-alert__close {
    background: none; border: none; cursor: pointer; color: inherit;
    margin-left: auto; padding: 0 0 0 8px; opacity: .65;
    font-size: 13px; flex-shrink: 0; transition: opacity .15s;
}
.wtr-msg .wtr-alert__close:hover { opacity: 1; }

/* ASP.NET input[type=submit] compatibility */
input[type="submit"].wtr-btn { display: block; }
input[type="submit"].wtr-btn--full { width: 100%; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
    .wtr-brand { width: 38%; min-width: 260px; padding: 40px 28px; }
    .wtr-brand__tagline { margin-bottom: 32px; }
}

@media (max-width: 640px) {
    .wtr-page { flex-direction: column; }

    .wtr-brand {
        width: 100%;
        min-width: unset;
        padding: 28px 24px;
    }
    .wtr-brand__tagline { margin-bottom: 0; font-size: 15px; }
    .wtr-brand__logo    { margin-bottom: 12px; }
    .wtr-brand__features { display: none; }

    .wtr-login-panel { padding: 28px 16px; }
    .wtr-login-card__header { padding: 28px 24px 22px; }
    .wtr-login-card__body   { padding: 24px 24px 28px; }
    .wtr-alert { margin: 0 24px; }
}

@media (max-width: 380px) {
    .wtr-login-card__header { padding: 22px 16px 18px; }
    .wtr-login-card__body   { padding: 20px 16px 24px; }
    .wtr-alert { margin: 0 16px; }
}
