/* ── REGISTRAZIONE WIZARD v1 ── */

*, *::before, *::after { box-sizing: border-box; }

.reg-page {
    min-height: 100vh;
    background: var(--c-bg, #faf9f7);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 60px;
}

/* ── Header ── */
.reg-header {
    width: 100%;
    max-width: 520px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 28px;
}

.reg-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--c-text, #1a1714);
    font-family: var(--font-display,'Oswald',sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.reg-logo-emoji { font-size: 1.3rem; }

.reg-login-link {
    font-size: 0.82rem;
    color: var(--c-text-muted, #9aa3ad);
    text-decoration: none;
}
.reg-login-link span {
    color: var(--c-coral, #e36d62);
    font-weight: 700;
}

/* ── Progress ── */
.reg-progress {
    width: 100%;
    max-width: 520px;
    margin-bottom: 28px;
}

.reg-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.reg-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--c-border, #e0ddd8);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-text-muted, #9aa3ad);
    transition: all .25s;
    flex-shrink: 0;
    position: relative;
}
.reg-dot.active {
    border-color: var(--c-coral, #e36d62);
    background: var(--c-coral, #e36d62);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(227,109,98,.15);
}
.reg-dot.done {
    border-color: var(--c-coral, #e36d62);
    background: #fff;
    color: var(--c-coral, #e36d62);
}
.reg-dot.done::after {
    content: '✓';
    font-size: 1rem;
}
.reg-dot-num { transition: opacity .2s; }
.reg-dot.done .reg-dot-num { display: none; }

.reg-line {
    flex: 1;
    height: 2px;
    background: var(--c-border, #e0ddd8);
    transition: background .3s;
}
.reg-line.done { background: var(--c-coral, #e36d62); }

.reg-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.73rem;
    color: var(--c-text-muted, #9aa3ad);
    font-weight: 500;
}
.reg-labels span.active {
    color: var(--c-coral, #e36d62);
    font-weight: 700;
}

/* ── Card ── */
.reg-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 22px;
    padding: 32px 28px 28px;
    box-shadow: 0 4px 32px rgba(0,0,0,.08);
    transition: opacity .2s;
}

.wiz-hidden {
    display: none !important;
}

#step-2.reg-card {
    max-width: 900px;
}

.reg-card-title {
    font-family: var(--font-display,'Oswald',sans-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--c-text, #1a1714);
    margin: 0 0 4px;
    line-height: 1.1;
}
.reg-card-sub {
    font-size: 0.88rem;
    color: var(--c-text-muted, #9aa3ad);
    margin: 0 0 26px;
    line-height: 1.5;
}

/* ── Alert ── */
.reg-alert {
    background: #fff0ef;
    border: 1.5px solid #f5c6c4;
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #b71c1c;
    margin-bottom: 18px;
    display: none;
}
.reg-alert.visible { display: block; }

/* ── Fields ── */
.reg-field {
    margin-bottom: 17px;
}
.reg-field label {
    display: block;
    font-size: 0.81rem;
    font-weight: 700;
    color: var(--c-text, #1a1714);
    margin-bottom: 6px;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.reg-field label .opt {
    font-weight: 400;
    text-transform: none;
    color: var(--c-text-muted, #9aa3ad);
    font-size: 0.78rem;
    letter-spacing: 0;
}

.reg-field input[type=text],
.reg-field input[type=email],
.reg-field input[type=password],
.reg-field input[type=tel] {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid var(--c-border, #e0ddd8);
    border-radius: 13px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--c-text, #1a1714);
    background: var(--c-bg, #faf9f7);
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
.reg-field input:focus {
    outline: none;
    border-color: var(--c-coral, #e36d62);
    box-shadow: 0 0 0 3px rgba(227,109,98,.13);
    background: #fff;
}
.reg-field input.has-error { border-color: #d93025; }
.reg-field input.has-ok    { border-color: #2e7d32; }

.reg-field-hint {
    font-size: 0.74rem;
    color: var(--c-text-muted, #9aa3ad);
    margin-top: 4px;
}
.reg-field-hint.error { color: #d93025; }

/* ── Password strength ── */
.pwd-strength {
    display: flex;
    gap: 4px;
    margin-top: 7px;
}
.pwd-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--c-border, #e0ddd8);
    transition: background .2s;
}
.pwd-strength[data-level="1"] .pwd-bar:nth-child(1)         { background: #d93025; }
.pwd-strength[data-level="2"] .pwd-bar:nth-child(-n+2)      { background: #f57c00; }
.pwd-strength[data-level="3"] .pwd-bar:nth-child(-n+3)      { background: #f9a825; }
.pwd-strength[data-level="4"] .pwd-bar:nth-child(-n+4)      { background: #388e3c; }
.pwd-strength[data-level="5"] .pwd-bar                      { background: #2e7d32; }

.pwd-label {
    font-size: 0.73rem;
    margin-top: 3px;
    font-weight: 600;
    min-height: 1em;
    display: block;
}

/* ── Checkboxes ── */
.reg-checks {
    margin: 20px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.reg-check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--c-text-muted, #9aa3ad);
}
.reg-check input[type=checkbox] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--c-coral, #e36d62);
    cursor: pointer;
}
.reg-check strong { color: var(--c-text, #1a1714); }
.reg-check a { color: var(--c-coral, #e36d62); }

/* ── Buttons ── */
.reg-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-display,'Oswald',sans-serif);
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .15s, transform .1s, opacity .15s;
    text-align: center;
}
.reg-btn-primary {
    background: var(--c-coral, #e36d62);
    color: #fff;
}
.reg-btn-primary:hover:not(:disabled) { background: #d05a4f; }
.reg-btn-primary:active:not(:disabled) { transform: scale(.98); }
.reg-btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.reg-btn-back {
    background: transparent;
    color: var(--c-text-muted, #9aa3ad);
    border: 2px solid var(--c-border, #e0ddd8);
    margin-top: 10px;
}
.reg-btn-back:hover { border-color: #b0aaa4; color: var(--c-text, #1a1714); }

/* ── Step 2 ── */
.squad-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 22px;
    text-align: center;
}

.squad-preview {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.squad-slot {
    width: 90px;
    border: 2px dashed var(--c-border, #e0ddd8);
    border-radius: 14px;
    padding: 10px 6px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all .2s;
    min-height: 86px;
    justify-content: center;
}
.squad-slot.filled {
    border-style: solid;
    border-color: var(--c-coral, #e36d62);
    background: rgba(227,109,98,.05);
}
.squad-slot.is-captain {
    border-color: #c89520;
    background: rgba(200,149,32,.08);
}
.squad-slot img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.squad-slot-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--c-text, #1a1714);
    line-height: 1.2;
    word-break: break-word;
    max-width: 78px;
}
.squad-slot-cap {
    font-size: 0.62rem;
    color: #c89520;
    font-weight: 700;
}
.squad-slot-empty {
    font-size: 1.4rem;
    opacity: .22;
}

.squad-status {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--c-text-muted, #9aa3ad);
    margin-top: 4px;
}
.squad-status .s-ok   { color: #2e7d32; }
.squad-status .s-need { color: var(--c-coral, #e36d62); }

/* ── Barman instruction ── */
.bm-instruction {
    background: rgba(227,109,98,.07);
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 0.83rem;
    color: var(--c-text, #1a1714);
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: center;
}
.bm-instruction .tip {
    display: inline-block;
    background: rgba(200,149,32,.18);
    color: #7a5510;
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 0.76rem;
    font-weight: 700;
    margin-left: 4px;
}

/* ── Barman grid ── */
.bm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
@media (max-width: 500px) {
    .bm-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (min-width: 700px) {
    .bm-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 860px) {
    .bm-grid { grid-template-columns: repeat(5, 1fr); }
}

.bm-card {
    border: 2px solid var(--c-border, #e0ddd8);
    border-radius: 16px;
    padding: 16px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s, box-shadow .18s;
    position: relative;
    background: #fff;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.bm-card:hover:not(.bm-disabled) {
    border-color: var(--c-coral, #e36d62);
    box-shadow: 0 3px 14px rgba(227,109,98,.15);
}
.bm-card.bm-selected {
    border-color: var(--c-coral, #e36d62);
    background: rgba(227,109,98,.06);
}
.bm-card.bm-captain {
    border-color: #c89520;
    background: rgba(200,149,32,.07);
    box-shadow: 0 0 0 3px rgba(200,149,32,.18);
}
.bm-card.bm-disabled {
    opacity: .38;
    cursor: not-allowed;
    pointer-events: none;
}

/* Badge top-right */
.bm-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c-coral, #e36d62);
    color: #fff;
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}
.bm-card.bm-selected .bm-badge { display: flex; }
.bm-card.bm-captain  .bm-badge { display: flex; background: #c89520; font-size: 1rem; }

.bm-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 9px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.bm-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-text, #1a1714);
    line-height: 1.3;
    margin-bottom: 2px;
}
.bm-bar {
    font-size: 0.7rem;
    color: var(--c-text-muted, #9aa3ad);
    line-height: 1.3;
    margin-bottom: 8px;
}

/* Captain action inside card */
.bm-crown-btn {
    display: none;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(200,149,32,.15);
    color: #9a7015;
    border: none;
    border-radius: 7px;
    padding: 4px 8px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    transition: background .15s;
}
.bm-crown-btn:hover { background: rgba(200,149,32,.28); }
.bm-card.bm-selected .bm-crown-btn { display: block; }
.bm-card.bm-captain  .bm-crown-btn {
    background: rgba(200,149,32,.28);
    color: #7a5510;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .reg-card { padding: 24px 18px 22px; }
    .reg-card-title { font-size: 1.45rem; }
    .squad-slot { width: 80px; }
}

@media (prefers-color-scheme: dark) {
    .reg-page { background: #1a1714; }
    .reg-card { background: #25211d; box-shadow: 0 4px 32px rgba(0,0,0,.3); }
    .reg-field input[type=text],
    .reg-field input[type=email],
    .reg-field input[type=password],
    .reg-field input[type=tel] { background: #1a1714; color: #e8e0d5; border-color: #3a3530; }
    .reg-field input:focus { background: #25211d; }
    .bm-card { background: #25211d; border-color: #3a3530; color: #e8e0d5; }
    .bm-card:hover:not(.bm-disabled) { border-color: var(--c-coral, #e36d62); }
    .bm-card.bm-selected { background: rgba(227,109,98,.1); }
    .reg-logo { color: #e8e0d5; }
    .reg-card-title { color: #e8e0d5; }
}
