/*
 * skip song ~ cute minimal dark wizard
 * paginated setup flow
 */

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

:root {
    --black: #0a0a0a;
    --white: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --accent: #ff6b6b;
    --accent-soft: rgba(255, 107, 107, 0.1);
    --accent-glow: rgba(255, 107, 107, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Grain overlay */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

body {
    min-height: 100vh;
    background: var(--black);
    font-family: 'Outfit', -apple-system, sans-serif;
    color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    color: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out 0.1s backwards;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.progress-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-800);
    border: 2px solid var(--gray-700);
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: all 0.3s ease;
}

.progress-label {
    font-size: 0.7rem;
    color: var(--gray-600);
    text-transform: lowercase;
    transition: color 0.3s ease;
}

.progress-step.active .progress-num {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    box-shadow: 0 0 16px var(--accent-glow);
}

.progress-step.active .progress-label {
    color: var(--accent);
}

.progress-step.completed .progress-num {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--white);
}

.progress-step.completed .progress-label {
    color: var(--gray-400);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--gray-800);
    margin: 0 0.5rem;
    margin-bottom: 1.25rem;
}

/* Main */
main {
    flex: 1;
}

/* Wizard Pages */
.wizard-page {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.wizard-page.active {
    display: block;
}

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

.page-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-header p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Connect Cards */
.connect-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.connect-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.connect-card.connected {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--gray-900) 0%, rgba(255, 107, 107, 0.05) 100%);
}

.connect-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-800);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.connect-card.connected .connect-card-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

.connect-card-content {
    flex: 1;
    min-width: 0;
}

.connect-card-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.connect-card-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.connect-status {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

.connect-status:empty {
    display: none;
}

/* Action Cards Container */
.action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: start;
}

/* Action Cards */
.action-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.action-card.enabled {
    border-color: var(--gray-700);
}

.action-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-900);
}

.action-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.action-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.action-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-700);
    border-radius: 22px;
    transition: 0.2s;
}

.action-toggle-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.2s;
}

.action-toggle input:checked + .action-toggle-slider {
    background: var(--accent);
}

.action-toggle input:checked + .action-toggle-slider::before {
    transform: translateX(18px);
}

.action-card-title h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.action-card-title p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.action-card-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--gray-800);
    flex: 1;
}

/* Trigger Choice */
.trigger-choice {
    padding-top: 1rem;
}

.trigger-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    text-transform: lowercase;
}

.trigger-options {
    display: flex;
    gap: 0.5rem;
}

.trigger-option {
    flex: 1;
    cursor: pointer;
}

.trigger-option input {
    display: none;
}

.trigger-option-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.trigger-option input:checked + .trigger-option-box {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.trigger-option-icon {
    font-size: 1rem;
    color: var(--gray-500);
    transition: color 0.15s ease;
}

.trigger-option input:checked + .trigger-option-box .trigger-option-icon {
    color: var(--accent);
}

.trigger-option-name {
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: color 0.15s ease;
}

.trigger-option input:checked + .trigger-option-box .trigger-option-name {
    color: var(--white);
}

/* Trigger Config */
.trigger-config {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-800);
}

/* Form Elements */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: lowercase;
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 40px;
    padding: 0 0.875rem;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gray-600);
}

.form-group input::placeholder {
    color: var(--gray-600);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-hint {
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

/* Keyword Row */
.keyword-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--gray-400);
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.keyword-input {
    width: 100px;
    height: 32px;
    padding: 0 0.625rem;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    margin-left: auto;
}

.keyword-input:focus {
    outline: none;
    border-color: var(--gray-600);
}

/* Create Reward Inline */
.create-reward-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.create-reward-text {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--gray-800);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-700);
}

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

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--gray-700);
    color: var(--white);
}

/* Page Footer */
.page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-800);
}

.page-footer .btn-next {
    margin-left: auto;
}

.page-footer .btn-back {
    margin-right: auto;
}

/* Token Warning */
.token-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: #ef4444;
    margin-right: auto;
}

.warning-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: var(--white);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Finish Card */
.finish-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.url-section {
    margin-bottom: 1.5rem;
}

.url-section > label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: lowercase;
    margin-bottom: 0.5rem;
}

.url-box {
    display: flex;
    gap: 0.5rem;
}

.url-box input {
    flex: 1;
    height: 40px;
    padding: 0 0.875rem;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
}

.obs-steps {
    padding: 1rem;
    background: var(--black);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.obs-steps h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.obs-steps ol {
    list-style: none;
    counter-reset: step;
}

.obs-steps li {
    counter-increment: step;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding: 0.375rem 0;
    padding-left: 1.75rem;
    position: relative;
}

.obs-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-800);
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--gray-500);
}

.obs-steps li:last-child {
    color: var(--accent);
}

.obs-steps li:last-child::before {
    background: var(--accent-soft);
    color: var(--accent);
}

.obs-steps strong {
    color: var(--white);
}

.finish-note {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.finish-note:last-child {
    margin-bottom: 0;
}

.finish-note.warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.finish-note.warning .note-icon {
    color: #fbbf24;
    background: #fbbf24;
    color: var(--black);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.finish-note.help {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.finish-note.help .note-icon {
    background: #6366f1;
    color: var(--white);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.finish-note.help strong {
    color: #818cf8;
}

.note-icon {
    flex-shrink: 0;
    color: var(--accent);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 90%;
    max-width: 360px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-800);
}

.modal-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-800);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--gray-700);
    color: var(--white);
}

.modal-body {
    padding: 1rem;
}

.modal-status {
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.modal-status.success {
    color: var(--accent);
}

.modal-status.error {
    color: #ef4444;
}

.modal-status.pending {
    color: var(--gray-400);
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-800);
}

.modal-footer .btn {
    flex: 1;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Tablet - Stack action cards */
@media (max-width: 680px) {
    .container {
        max-width: 520px;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .progress-line {
        width: 24px;
    }

    .progress-label {
        font-size: 0.65rem;
    }

    .trigger-options {
        flex-direction: column;
    }

    .keyword-row {
        flex-wrap: wrap;
    }

    .keyword-input {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
