/* ================================================================
   FONT - FIFA 26 by Bynit (fontstruct.com/fontstructions/show/2296625)
   Licença não-comercial. Não use como webfont em projetos comerciais.
================================================================ */
@font-face {
    font-family: 'FIFA26';
    src: url('assets/fonts/fifa-26.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ================================================================
   RESET & TOKENS
================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --teal:    #4DD9D5;
    --green:   #00A550;
    --white:   #ffffff;
    --g100:    #f5f7fa;
    --g200:    #e8ecf0;
    --g500:    #6b7280;
    --g800:    #1f2937;
    --radius:  12px;

    /* Card dimensions - 49×65mm physical ratio at 600px height: width = round(600*49/65) = 452px */
    --cw: 452px;
    --ch: 600px;
    --csb: 48px;   /* sidebar width  */
    --cfh: 120px;  /* footer height  */

    --font-num: 'FIFA26', 'Arial Black', 'Arial Bold', Impact, sans-serif;
}

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #eaf6ff;
    color: var(--g800);
    min-height: 100vh;
}

/* ================================================================
   APP SHELL
================================================================ */
.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 16px 56px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ================================================================
   TWO-COLUMN LAYOUT
================================================================ */
.app-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.wizard-col {
    flex: 1;
    min-width: 0;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.preview-col {
    width: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: sticky;
    top: 24px;
}

/* Responsive visibility helpers */
@media (max-width: 899px) {
    .app-layout       { flex-direction: column; }
    .wizard-col       { max-width: 100%; }
    .preview-col      { width: 100%; position: static; display: none; }
    .preview-col.show { display: flex; }
    .desktop-only     { display: none !important; }
}
/* On desktop the card-stage width is set by JS; on mobile it fills the column */
@media (max-width: 899px) {
    .card-stage { width: 100% !important; }
}
@media (min-width: 900px) {
    .mobile-only { display: none !important; }
}

/* Step 3 hint text */
.step3-hint {
    font-size: 0.9rem;
    color: var(--g500);
    margin-top: -8px;
}

header { text-align: center; }

header h1 {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
}
header h1 em {
    font-style: normal;
    color: var(--teal);
}
header p {
    margin-top: 6px;
    color: var(--g500);
    font-size: 0.9rem;
}

/* ================================================================
   STEPS NAV
================================================================ */
.steps-nav {
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
}

.step-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--g200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--g500);
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.step-label {
    font-size: 0.75rem;
    color: var(--g500);
    font-weight: 500;
    transition: color 0.25s;
}

.step-node.active .step-badge { background: var(--teal);  border-color: var(--teal);  color: #fff; }
.step-node.active .step-label { color: var(--teal); font-weight: 700; }
.step-node.done  .step-badge  { background: var(--green); border-color: var(--green); color: #fff; }
.step-node.done  .step-label  { color: var(--green); }

.step-connector {
    flex: 1;
    height: 2px;
    max-width: 80px;
    background: var(--g200);
    margin-bottom: 22px;
    transition: background 0.25s;
}
.step-connector.done { background: var(--green); }

/* ================================================================
   WIZARD PANELS
================================================================ */
main {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.step-panel {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeUp 0.2s ease;
}
.step-panel.hidden { display: none; }
.step-panel h2 { font-size: 1.2rem; font-weight: 700; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ================================================================
   DROP ZONE (Step 1)
================================================================ */
.drop-zone {
    display: block;
    cursor: pointer;
    border: 2px dashed var(--g200);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 200px;
    position: relative;
    transition: border-color 0.2s;
}
.drop-zone:hover,
.drop-zone.drag-over { border-color: var(--teal); }

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
    pointer-events: none;
}
.drop-prompt p    { font-weight: 500; color: var(--g800); }
.drop-prompt span { font-size: 0.8rem; color: var(--g500); }

.photo-preview {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    background: var(--g100);
    display: block;
}
.photo-preview.hidden { display: none; }

/* ================================================================
   TIP
================================================================ */
.tip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--g500);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 14px;
    flex-wrap: wrap;
    line-height: 1.5;
}
.tip svg { flex-shrink: 0; color: var(--green); }
.tip strong { color: var(--g800); }
.tip a { color: var(--green); font-weight: 600; text-decoration: none; }
.tip a:hover { text-decoration: underline; }

/* ================================================================
   FORM FIELDS (Step 2)
================================================================ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--g500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.field input,
.field select {
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--g200);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--g800);
    background: var(--white);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.field input:focus,
.field select:focus { border-color: var(--teal); }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 420px) {
    .field-row { grid-template-columns: 1fr 1fr; }
}

.suffix-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--g200);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.suffix-wrap:focus-within { border-color: var(--teal); }
.suffix-wrap input {
    flex: 1;
    border: none;
    border-radius: 0;
    height: 44px;
    padding: 0 8px 0 14px;
    font-size: 0.95rem;
    color: var(--g800);
    background: var(--white);
    font-family: inherit;
    outline: none;
    min-width: 0;
}
.suffix-unit {
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--g500);
    background: var(--g100);
    height: 44px;
    display: flex;
    align-items: center;
    border-left: 1.5px solid var(--g200);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ================================================================
   BUTTONS
================================================================ */
.panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 4px;
}
.panel-footer.center { justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.2s;
}

.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover:not(:disabled) {
    background: #3bc4c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(77,217,213,.45);
}
.btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.secondary {
    background: var(--g100);
    color: var(--g800);
    border: 1.5px solid var(--g200);
}
.btn.secondary:hover { background: var(--g200); }

.btn.download { background: var(--green); color: #fff; padding: 0 32px; }
.btn.download:hover:not(:disabled) {
    background: #009144;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,165,80,.4);
}
.btn.download:disabled { opacity: 0.55; cursor: wait; }

/* ================================================================
   CARD STAGE  (scaling wrapper)
================================================================ */
.card-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible;
    /* height set by JS after scaling */
}

/* ================================================================
   STICKER CARD  - 500 × 700 px
================================================================ */
#sticker-card {
    position: relative;
    width:  var(--cw);
    height: var(--ch);
    border-radius: 16px;
    overflow: hidden;
    background-color: #4DD9D5;
    flex-shrink: 0;
    transform-origin: top center;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* --- holographic shimmer --- */
.c-holo {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        128deg,
        rgba(255, 20,147,.06)  0%,
        rgba(255,165,  0,.06) 16%,
        rgba(255,255,  0,.06) 32%,
        rgba(  0,255,127,.06) 48%,
        rgba(  0,191,255,.06) 64%,
        rgba(138, 43,226,.06) 80%,
        rgba(255, 20,147,.06) 100%
    );
    mix-blend-mode: screen;
    z-index: 9;
    pointer-events: none;
}

/* --- large background "26" --- */
.c-bg-num {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-num);
    font-size: 660px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -20px;
    color: #00A550;
    opacity: .88;
    z-index: 1;
    white-space: nowrap;
    pointer-events: none;
}

/* --- gold accent rectangle behind player torso --- */
.c-gold {
    position: absolute;
    left: 50px;
    top: 108px;
    width: 272px;
    height: 190px;
    background: #F5C330;
    opacity: .92;
    z-index: 2;
}

/* --- player photo --- */
.c-photo {
    position: absolute;
    bottom: calc(var(--cfh) - 8px);
    left: 50%;
    transform: translateX(calc(-50% - 24px));
    height: 520px;
    width: auto;
    max-width: 360px;
    object-fit: contain;
    z-index: 4;
}

/* --- FIFA logo on teal background, top-right --- */
.c-fifa {
    position: absolute;
    top: 12px;
    right: calc(var(--csb) + 8px);
    width: 46px;
    height: auto;
    object-fit: contain;
    z-index: 6;
    /* filter ensures the logo reads as white on the teal bg */
    filter: brightness(0) invert(1);
}

/* --- right sidebar (flag + country code only) --- */
.c-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--csb);
    height: 100%;
    background: #fff;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0 16px;
    gap: 14px;
}

.c-flag-wrap {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--g200);
}
.c-flag {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c-code {
    font-family: var(--font-num);
    font-size: 16px;
    font-weight: 900;
    color: #00A550;
    letter-spacing: 6px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
}

/* --- footer panel --- */
.c-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--cfh);
    background: #fff;
    border-radius: 14px 14px 0 0;
    z-index: 6;
    display: flex;
    align-items: center;
    padding: 12px calc(var(--csb) + 8px) 10px 18px;
    gap: 10px;
}

.c-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.c-name {
    font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #111;
    text-transform: uppercase;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-stats {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    white-space: nowrap;
}

.c-club {
    font-size: 12.5px;
    font-weight: 700;
    color: #222;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.c-panini {
    height: 34px;
    width: auto;
    flex-shrink: 0;
    align-self: flex-end;
    object-fit: contain;
}

/* ================================================================
   APP FOOTER
================================================================ */
.app-footer p {
    width: 670px;
    max-width: 100%;
    text-align: justify;
    text-align-last: center;
    margin: 3rem auto 0;
    font-size: 0.6rem;
    color: var(--g500);
    line-height: 1.6;
}
.app-footer a {
    color: var(--g500);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.app-footer a:hover { color: var(--g800); }
