/* v2 verification wizard — custom styles on top of Bootstrap 5 */

:root {
    --bg-accent: #2a3e83;
    --bg-accent-dark: #151e2f;
    --bg-success: #43b754;
    --bg-success-dark: #399a49;
}

html, body {
    background: transparent;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 16px;
    color: #2b2b2b;
    min-height: 600px;
    font-size: 16px;
    line-height: 1.5;
}

.wizard {
    max-width: 520px;
    margin: 0 auto;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #6c757d;
}
.stepper .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dee2e6;
    transition: background 0.2s;
}
.stepper .dot.active { background: var(--bg-accent); }
.stepper .dot.done { background: var(--bg-success); }
.stepper .label { margin-left: auto; }

/* Cards (used for shop and platform pickers) */
.choice-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    margin-bottom: 10px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
    text-align: left;
    width: 100%;
}
.choice-card:hover {
    border-color: var(--bg-accent);
    box-shadow: 0 2px 8px rgba(42, 62, 131, 0.12);
}
.choice-card:active { transform: scale(0.99); }
.choice-card .icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.choice-card .logo {
    flex: 0 0 96px;
    width: 96px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
}
.choice-card .logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}
.choice-card .body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}
.choice-card .name {
    display: block;
    font-weight: 600;
    font-size: 17px;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.25;
}
.choice-card .desc {
    display: block;
    font-size: 14.5px;
    color: #6c757d;
    line-height: 1.4;
}
.choice-card .arrow {
    color: #adb5bd;
    font-size: 20px;
    transition: transform 0.15s;
}
.choice-card:hover .arrow { transform: translateX(2px); color: var(--bg-accent); }

/* Step header */
.step-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
    line-height: 1.25;
}
.step-subtitle {
    font-size: 16px;
    color: #495057;
    margin-bottom: 20px;
    line-height: 1.5;
}
.step-subtitle code {
    background: #fff3cd;
    color: #664d03;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 15px;
}

/* Inputs */
.field-label {
    font-weight: 600;
    font-size: 15px;
    color: #343a40;
    margin-bottom: 6px;
    display: block;
}
.form-control.wizard-input {
    height: 52px;
    font-size: 17px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    padding: 0 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control.wizard-input:focus {
    border-color: var(--bg-accent);
    box-shadow: 0 0 0 3px rgba(42, 62, 131, 0.15);
    outline: none;
}
.form-control.wizard-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.field-hint {
    font-size: 14.5px;
    color: #6c757d;
    margin-top: 10px;
    line-height: 1.55;
}
.field-hint code {
    background: #f1f3f5;
    color: #495057;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13.5px;
}

/* Inline alerts */
.inline-alert {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14.5px;
    line-height: 1.5;
}
.inline-alert.warn {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #6c4a00;
}
.inline-alert code {
    background: rgba(0,0,0,0.07);
    padding: 1px 4px;
    border-radius: 3px;
}

/* "Where do I find this?" expandable panel */
.find-toggle {
    display: inline-block;
    font-size: 14.5px;
    color: var(--bg-accent);
    background: none;
    border: none;
    padding: 8px 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-skip-ink: none;
}
.find-toggle:hover { color: var(--bg-accent-dark); }
.find-panel {
    margin-top: 8px;
    padding: 12px;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
}
.find-panel img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Buttons */
.btn-wizard-primary {
    background: var(--bg-success);
    color: #fff;
    border: none;
    height: 52px;
    padding: 0 24px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-wizard-primary:hover:not(:disabled) {
    background: var(--bg-success-dark);
}
.btn-wizard-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-wizard-primary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.btn-wizard-secondary {
    background: transparent;
    color: #495057;
    border: 1.5px solid #ced4da;
    height: 52px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
}
.btn-wizard-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    align-items: center;
}
.btn-row .spacer { flex: 1; }

/* Submitting */
.submitting {
    text-align: center;
    padding: 40px 20px;
}
.submitting .spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}

/* Result — code display */
.code-box {
    margin: 20px auto;
    text-align: center;
    background: linear-gradient(180deg, #f8fbff 0%, #ecf2ff 100%);
    border: 2px solid var(--bg-accent);
    border-radius: 14px;
    padding: 24px 16px;
}
.code-box .code-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}
.code-box .code-value {
    font-family: ui-monospace, SFMono-Regular, "Menlo", "Consolas", monospace;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--bg-accent-dark);
    line-height: 1.1;
    word-break: break-all;
}
.code-box .code-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.code-box .countdown {
    margin-top: 12px;
    font-size: 14.5px;
    color: #495057;
}

.btn-copy {
    background: #fff;
    color: var(--bg-accent);
    border: 1.5px solid var(--bg-accent);
    height: 40px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-copy:hover { background: var(--bg-accent); color: #fff; }
.btn-copy.copied {
    background: var(--bg-success);
    color: #fff;
    border-color: var(--bg-success);
}

/* Diagnostic invalid-purchase pane */
.diag {
    border-radius: 12px;
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    padding: 18px;
    margin-top: 16px;
}
.diag h3 {
    margin: 0 0 8px 0;
    font-size: 19px;
    color: #842029;
}
.diag .submitted {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 14.5px;
}
.diag .submitted .row {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f3f5;
}
.diag .submitted .row:last-child { border-bottom: none; }
.diag .submitted .label {
    flex: 0 0 130px;
    color: #6c757d;
    font-weight: 500;
}
.diag .submitted .value {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, "Menlo", "Consolas", monospace;
    color: #2b2b2b;
    word-break: break-all;
}

.fix-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}
.fix-card .title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a1a1a;
}
.fix-card .body {
    font-size: 14.5px;
    color: #495057;
    margin-bottom: 12px;
    line-height: 1.5;
}
.fix-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Xbox waiting */
.waiting {
    text-align: center;
    padding: 30px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}
.waiting .pulse {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(42, 62, 131, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}
.waiting .pulse svg { width: 28px; height: 28px; color: var(--bg-accent); }
.waiting .countdown { color: #6c757d; font-size: 14.5px; margin-top: 12px; }
.waiting img { max-width: 220px; margin-top: 16px; border-radius: 6px; }

/* Footer */
.wizard-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #868e96;
    text-align: center;
    line-height: 1.55;
}
.wizard-footer a { color: var(--bg-accent); }

/* Mobile tweaks */
@media (max-width: 480px) {
    body { padding: 12px; font-size: 15.5px; }
    .step-title { font-size: 22px; }
    .step-subtitle { font-size: 15px; }
    .field-hint, .inline-alert, .choice-card .desc { font-size: 14px; }
    .code-box .code-value { font-size: 38px; letter-spacing: 4px; }
    .choice-card .icon { width: 38px; height: 38px; font-size: 19px; flex-basis: 38px; }
    .choice-card .logo { flex-basis: 76px; width: 76px; height: 40px; padding: 3px 6px; }
    .choice-card .name { font-size: 16px; }
    .btn-wizard-primary, .btn-wizard-secondary { font-size: 15px; padding: 0 16px; height: 46px; }
    .form-control.wizard-input { height: 48px; font-size: 16px; }
}

/* Hide elements until Alpine.js initializes — prevents flicker of all steps */
[x-cloak] { display: none !important; }
