/* User Redeem Page Design System */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: #eef2ff;

    --bg-main: #f9fafb;
    --bg-surface: #ffffff;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);

    --border-base: #e2e8f0;

    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, inherit;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-base);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-inline {
    width: auto;
    flex: 0 0 auto;
}

.btn-xs {
    width: auto;
    flex: 0 0 auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 8px;
    gap: 0.35rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-base);
}

.btn-secondary:hover {
    background-color: var(--bg-main);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-base);
    display: none;
    z-index: 100;
}

.toast.show {
    display: block;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.badge-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.25);
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Spots summary */
.spots-panel {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.spots-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.spots-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-soft);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-full);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--primary);
}

.spots-item i {
    width: 14px;
    height: 14px;
}

.spots-label {
    color: var(--text-muted);
    font-weight: 600;
}

.spots-value {
    font-weight: 800;
    color: var(--primary);
}

.spots-list:hover {
    opacity: 0.85;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 88px;
    color: var(--text-muted);
}

.stepper-dot {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-base);
    background: var(--bg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    transition: var(--transition-base);
}

.stepper-text {
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition-base);
}

.stepper-connector {
    width: 42px;
    height: 2px;
    background: var(--border-base);
    border-radius: 999px;
    opacity: 0.9;
}

.stepper-step.active {
    color: var(--primary);
}

.stepper-step.active .stepper-dot {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.stepper-step.done {
    color: var(--success);
}

.stepper-step.done .stepper-dot {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.35);
}

/* Guide */
.guide-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.guide-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.guide-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.guide-title i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.guide-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.guide-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    background: var(--bg-main);
}

.guide-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    border: 1px solid var(--border-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-item-icon i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.guide-item-title {
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.guide-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.guide-details {
    border-top: 1px dashed var(--border-base);
    padding-top: 0.75rem;
}

.guide-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.9rem;
}

.guide-summary i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.guide-details summary::-webkit-details-marker {
    display: none;
}

.guide-faq {
    margin-top: 0.75rem;
    padding-left: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Team selection */
.teams-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-card {
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: var(--bg-main);
    cursor: pointer;
    transition: var(--transition-base);
}

.team-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.team-card.selected {
    background: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.team-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.team-name {
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.team-tag {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.team-remaining {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.team-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.team-info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.team-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid var(--border-base);
}

.badge-plus {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.10);
}

.badge-pro {
    color: var(--success);
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.25);
}

.actions {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Result */
.result-success {
    text-align: center;
}

.result-error {
    text-align: center;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.result-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.result-details {
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: left;
    margin-bottom: 2rem;
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-base);
}

.result-detail-item:last-child {
    border-bottom: none;
}

.result-detail-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-detail-value {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .header {
        margin-bottom: 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .guide-card {
        padding: 1.1rem;
    }

    .guide-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stepper-step {
        min-width: 72px;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }

    .result-title {
        font-size: 1.25rem;
    }
}
