:root{--bg:#f4f7f5;--card:#fff;--text:#13211c;--muted:#66776f;--line:#d6e1dc;--green:#168c51;--green2:#0f7442;--danger:#b43b42;--soft:#eef5f1;--shadow:0 24px 70px rgba(18,44,33,.12)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg)}body{min-height:100vh;display:flex}.auth-shell{width:min(1120px,calc(100% - 32px));margin:auto;padding:32px 0}.auth-card{background:var(--card);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow);overflow:hidden}.auth-grid{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(0,1.4fr)}.auth-side{padding:44px;background:linear-gradient(145deg,#0c2b20,#0b1713);color:#fff}.auth-side h1{font-size:38px;margin:8px 0 12px}.auth-side h1 span{color:#48e799}.auth-side p{color:#bfd0c8;line-height:1.55}.auth-main{padding:42px}.eyebrow{font-size:13px;letter-spacing:.14em;font-weight:800;color:var(--green);text-transform:uppercase}.auth-main h2{font-size:32px;margin:8px 0 10px}.lead{color:var(--muted);line-height:1.5;margin:0 0 28px}.field{display:grid;gap:8px;margin-bottom:16px}.field label,.field>span{font-weight:700;font-size:14px}.field input,.field select{width:100%;height:50px;border:1px solid var(--line);border-radius:14px;padding:0 15px;font:inherit;color:var(--text);background:#fff;outline:none}.field input:focus,.field select:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(22,140,81,.12)}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.btn{min-height:50px;border-radius:14px;border:1px solid var(--line);padding:0 20px;font:700 15px/1 inherit;display:inline-flex;align-items:center;justify-content:center;gap:9px;cursor:pointer;text-decoration:none}.btn.primary{background:var(--green);color:#fff;border-color:var(--green)}.btn.primary:hover{background:var(--green2)}.btn.ghost{background:#fff;color:var(--text)}.actions{display:flex;gap:12px;align-items:center;margin-top:24px;flex-wrap:wrap}.error,.success{border-radius:14px;padding:13px 15px;margin:0 0 18px}.error{background:#fff0f1;color:#9c2931;border:1px solid #f0c2c5}.success{background:#ecf8f1;color:#146c40;border:1px solid #bfe5cf}.remember{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:14px}.remember input{width:18px;height:18px}.auth-links{display:flex;justify-content:space-between;margin-top:18px;font-size:14px}.auth-links a{color:var(--green);font-weight:700;text-decoration:none}.password-rules{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px;margin-top:8px;font-size:12px;color:var(--muted)}.password-rules span.ok{color:var(--green);font-weight:700}.strength{height:7px;background:#e6eeea;border-radius:99px;overflow:hidden;margin-top:8px}.strength>i{display:block;height:100%;width:0;background:var(--danger);transition:.2s}.strength.medium>i{background:#d99a1b}.strength.strong>i{background:var(--green)}.install-progress{display:flex;gap:8px;margin-bottom:28px}.install-progress span{height:6px;flex:1;border-radius:99px;background:#e5ece8}.install-progress span.active{background:var(--green)}.step{display:none}.step.active{display:block}.team-list{display:grid;gap:10px;max-height:430px;overflow:auto;padding-right:5px}.team-row{display:grid;grid-template-columns:50px 1fr 1fr;gap:10px;align-items:end;padding:12px;border:1px solid var(--line);border-radius:16px;background:#fbfcfb}.team-num{width:38px;height:38px;border-radius:12px;background:var(--soft);display:grid;place-items:center;font-weight:800;color:var(--green);align-self:center}.summary-box{padding:18px;border-radius:16px;background:var(--soft);border:1px solid var(--line);line-height:1.65}.footer-note{margin-top:22px;color:var(--muted);font-size:12px}.account-head{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:24px}.account-head a{color:var(--green);font-weight:700;text-decoration:none}
@media(max-width:820px){.auth-shell{width:min(100% - 20px,720px);padding:10px 0}.auth-grid{grid-template-columns:1fr}.auth-side{padding:28px}.auth-side h1{font-size:30px}.auth-main{padding:26px}.form-grid,.form-grid.three{grid-template-columns:1fr}.team-row{grid-template-columns:42px 1fr}.team-row .coach-field{grid-column:2}.password-rules{grid-template-columns:1fr}.auth-links{gap:12px;flex-direction:column}}
@media(prefers-color-scheme:dark){:root{--bg:#07110e;--card:#0d1b16;--text:#edf6f2;--muted:#93a99f;--line:#243a31;--soft:#13261f}.field input,.field select,.btn.ghost{background:#0b1713;color:var(--text)}.team-row{background:#0b1713}}

/* V36 installer: new league / import existing */
.step-kicker{font-size:.78rem;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#178a51;margin-bottom:10px}
.setup-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:22px 0}
.setup-choice{appearance:none;text-align:left;border:1px solid #d6e1dc;background:#f7faf8;border-radius:18px;padding:20px;min-height:132px;cursor:pointer;font:inherit;color:#17231e;transition:.18s ease;display:flex;flex-direction:column;gap:8px}
.setup-choice strong{font-size:1.08rem}.setup-choice span{font-size:.9rem;line-height:1.45;color:#62736b}.setup-choice:hover,.setup-choice.selected{border-color:#188b52;box-shadow:0 0 0 2px rgba(24,139,82,.10);background:#eff9f3}.setup-choice.selected:before{content:'Selezionato';font-size:.72rem;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#188b52}
.security-list{display:grid;gap:8px;margin-top:24px;font-size:.84rem;color:#9fb8ad}.security-list span:before{content:'✓';color:#48e799;font-weight:900;margin-right:8px}
.import-drop{border:1px dashed #bfd0c8;border-radius:18px;padding:24px;background:#f8fbf9}.import-drop p{color:#65766e}.file-select{display:inline-flex;position:relative;overflow:hidden}.file-select input{position:absolute;inset:0;opacity:0;cursor:pointer}
.backup-preview{margin-top:16px;border:1px solid #cfe1d8;background:#eff9f3;border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:4px}.backup-preview strong{font-size:1rem}.backup-preview span{font-size:.86rem;color:#5d6f66}.backup-preview .bad{color:#b53a3f;font-weight:800}
.field small{display:block;margin-top:6px;font-size:.75rem;color:#718078;line-height:1.4}
@media(max-width:760px){.setup-choice-grid{grid-template-columns:1fr}.setup-choice{min-height:auto}.team-row{grid-template-columns:34px 1fr!important}.team-row .coach-field{grid-column:2}}

/* V37 · Tema condiviso con l'app */
html[data-theme="light"]{color-scheme:light;--bg:#f4f7f5;--card:#fff;--text:#13211c;--muted:#66776f;--line:#d6e1dc;--green:#168c51;--green2:#0f7442;--danger:#b43b42;--soft:#eef5f1;--shadow:0 24px 70px rgba(18,44,33,.12)}
html[data-theme="dark"]{color-scheme:dark;--bg:#07110e;--card:#0d1b16;--text:#edf6f2;--muted:#93a99f;--line:#243a31;--green:#46e58a;--green2:#1fbf6b;--danger:#ff6b6b;--soft:#13261f;--shadow:0 24px 70px rgba(0,0,0,.34)}
html[data-theme="dark"] body{background:#07110e;color:var(--text)}
html[data-theme="dark"] .auth-card{background:#0d1b16;border-color:#243a31}
html[data-theme="dark"] .auth-main{background:#0d1b16}
html[data-theme="dark"] .field input,html[data-theme="dark"] .field select,html[data-theme="dark"] .btn.ghost{background:#0b1713;color:var(--text);border-color:#243a31}
html[data-theme="dark"] .team-row,html[data-theme="dark"] .setup-choice,html[data-theme="dark"] .import-drop{background:#0b1713;color:var(--text);border-color:#243a31}
html[data-theme="dark"] .setup-choice span,html[data-theme="dark"] .import-drop p{color:var(--muted)}
html[data-theme="dark"] .setup-choice:hover,html[data-theme="dark"] .setup-choice.selected{background:#13261f;border-color:#46e58a}
html[data-theme="dark"] .summary-box,html[data-theme="dark"] .backup-preview{background:#13261f;border-color:#29493c}
html[data-theme="dark"] .auth-side{background:linear-gradient(145deg,#0a2119,#07110e)}
html[data-theme="light"] .auth-side{background:linear-gradient(145deg,#0c2b20,#0b1713)}
.auth-theme-control{position:fixed;right:20px;top:20px;z-index:100;min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:14px;background:var(--card);box-shadow:0 8px 24px rgba(0,0,0,.08);display:inline-flex;align-items:center;gap:8px;color:var(--text)}
.auth-theme-control svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.auth-theme-control select{appearance:none;border:0!important;background:transparent!important;color:var(--text)!important;font:700 14px/1 Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;padding:0 18px 0 0!important;outline:none;width:auto!important;height:auto!important}
.auth-theme-control:after{content:'⌄';position:absolute;right:10px;top:50%;transform:translateY(-55%);font-size:12px;color:var(--muted);pointer-events:none}
@media(max-width:720px){.auth-theme-control{right:10px;top:10px}.auth-theme-control select{max-width:90px}.auth-shell{padding-top:64px}}

/* V38 · Form controls coerenti con il tema esplicito */
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background:#fff !important;
  color:#13211c !important;
  border-color:#d6e1dc !important;
  -webkit-text-fill-color:#13211c !important;
  caret-color:#13211c;
  color-scheme:light;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color:#8a9891 !important;
  -webkit-text-fill-color:#8a9891 !important;
  opacity:1;
}
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled,
html[data-theme="light"] textarea:disabled,
html[data-theme="light"] input[readonly] {
  background:#f1f4f2 !important;
  color:#5f6f67 !important;
  -webkit-text-fill-color:#5f6f67 !important;
  opacity:1;
}
html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] input:-webkit-autofill:hover,
html[data-theme="light"] input:-webkit-autofill:focus {
  -webkit-box-shadow:0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color:#13211c !important;
  caret-color:#13211c !important;
}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background:#0b1713 !important;
  color:#edf6f2 !important;
  border-color:#243a31 !important;
  -webkit-text-fill-color:#edf6f2 !important;
  caret-color:#edf6f2;
  color-scheme:dark;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color:#7f978d !important;
  -webkit-text-fill-color:#7f978d !important;
  opacity:1;
}
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-box-shadow:0 0 0 1000px #0b1713 inset !important;
  -webkit-text-fill-color:#edf6f2 !important;
  caret-color:#edf6f2 !important;
}

/* V43 · Pulsanti secondari auth coerenti con tema esplicito */
html[data-theme="light"] .btn.ghost,
html[data-theme="light"] a.btn.ghost,
html[data-theme="light"] button.btn.ghost {
  background:#ffffff !important;
  color:#13211c !important;
  border-color:#d6e1dc !important;
  -webkit-text-fill-color:#13211c !important;
  box-shadow:none;
}
html[data-theme="light"] .btn.ghost:hover,
html[data-theme="light"] a.btn.ghost:hover,
html[data-theme="light"] button.btn.ghost:hover {
  background:#f4f7f5 !important;
  border-color:#bfcfc7 !important;
  color:#13211c !important;
  -webkit-text-fill-color:#13211c !important;
}
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] a.btn.ghost,
html[data-theme="dark"] button.btn.ghost {
  background:#0b1713 !important;
  color:#edf6f2 !important;
  border-color:#243a31 !important;
  -webkit-text-fill-color:#edf6f2 !important;
}
html[data-theme="dark"] .btn.ghost:hover,
html[data-theme="dark"] a.btn.ghost:hover,
html[data-theme="dark"] button.btn.ghost:hover {
  background:#13261f !important;
  border-color:#365449 !important;
}
