* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --bg-primary: #0a0e14;
    --bg-secondary: #12161f;
    --bg-tertiary: #1a1f2e;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f6fc;
    --text-secondary: #a0aec0;
    --text-muted: #6b7280;
    --accent-green: #22c55e;
    --accent-green-glow: rgba(34, 197, 94, 0.4);
    --accent-orange: #f7931a;
    --accent-orange-glow: rgba(247, 147, 26, 0.4);
    --accent-blue: #3b82f6;
    --error-red: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    margin: 0;
    padding: 40px 20px;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 540px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    height: 48px;
    width: auto;
}

.tagline {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Feature pills */
.features {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.feature svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    stroke: var(--accent-orange);
}

/* Why SatoshiSend */
.why-section {
    margin: 32px 0;
    padding: 28px;
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.why-section h2 {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.why-item {
    text-align: center;
    padding: 16px;
}

.why-item svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-orange);
    margin-bottom: 12px;
}

.why-item h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.why-item p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .why-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* How It Works */
.how-it-works {
    margin: 32px 0;
    padding: 28px;
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.how-it-works h2 {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e8850f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 2px 8px var(--accent-orange-glow);
}

.step-content h3 {
    margin: 0 0 6px 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-content strong {
    color: var(--accent-orange);
}

/* Sections */
.section {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    margin: 20px 0;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    transition: all 0.3s ease;
    animation: fadeSlideIn 0.4s ease-out;
}

.section:hover {
    border-color: var(--border-hover);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

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

.section h2 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section p {
    margin: 0 0 16px 0;
}

.hidden {
    display: none !important;
}

/* File Input / Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 20px;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--accent-orange);
    background: rgba(247, 147, 26, 0.05);
    box-shadow: 0 0 30px rgba(247, 147, 26, 0.1) inset;
}

.file-drop-zone.has-file {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.05);
}

.file-drop-zone input[type="file"] {
    display: none;
}

.file-drop-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.file-drop-zone:hover .file-drop-icon {
    opacity: 0.8;
}

.file-drop-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.file-drop-text strong {
    color: var(--accent-orange);
}

.file-drop-limit {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 8px;
}

.file-name {
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    color: var(--accent-green);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pricing Info */
.pricing-info {
    margin-top: 20px;
    padding: 16px;
    background: rgba(247, 147, 26, 0.05);
    border: 1px solid rgba(247, 147, 26, 0.2);
    border-radius: 10px;
    text-align: center;
}

.pricing-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pricing-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pricing-rate {
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 1rem;
}

.pricing-separator {
    color: var(--text-muted);
}

.pricing-minimum,
.pricing-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
button {
    background: linear-gradient(135deg, var(--accent-green) 0%, #16a34a 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-green-glow);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

button.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

button.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    box-shadow: none;
}

/* Multi-Phase Progress */
.phase-progress {
    margin: 20px 0;
}

.phase {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.phase.active,
.phase.complete {
    opacity: 1;
}

.phase-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.phase-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.phase.active .phase-icon {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    box-shadow: 0 0 12px var(--accent-orange-glow);
}

.phase.complete .phase-icon {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
    box-shadow: 0 0 12px var(--accent-green-glow);
}

.phase.complete .phase-icon::before {
    content: '✓';
}

.phase.complete .phase-icon {
    font-size: 0;
}

.phase.complete .phase-icon::before {
    font-size: 0.75rem;
}

.phase-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.phase.active .phase-name,
.phase.complete .phase-name {
    color: var(--text-primary);
}

.phase-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-color) inset;
}

.phase-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.2s ease;
    background: var(--bg-tertiary);
}

.phase.active .phase-fill {
    background: linear-gradient(90deg, var(--accent-orange), #fbbf24);
    box-shadow: 0 0 8px var(--accent-orange-glow);
}

.phase.complete .phase-fill {
    background: linear-gradient(90deg, var(--accent-green), #4ade80);
    box-shadow: 0 0 8px var(--accent-green-glow);
}

.phase-status {
    margin: 16px 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.phase-status.error {
    color: var(--error-red);
}

/* WebLN Pay Button */
.webln-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e8850f 100%);
    box-shadow: 0 2px 12px var(--accent-orange-glow);
    font-size: 1.05rem;
}

.webln-pay:hover:not(:disabled) {
    box-shadow: 0 4px 20px var(--accent-orange-glow);
}

/* Invoice Display */
.invoice-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.qr-container {
    text-align: center;
    margin-bottom: 16px;
}

.qr-container canvas {
    border-radius: 12px;
    background: white;
    padding: 12px;
}

.invoice-code-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
}

#invoice-code {
    flex: 1;
    word-break: break-all;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.4;
    max-height: 60px;
    overflow-y: auto;
}

.amount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 20px 0;
}

.amount-display .sats {
    color: var(--accent-orange);
    text-shadow: 0 0 20px var(--accent-orange-glow);
}

.amount-display .label {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1rem;
}

/* Payment Status */
.payment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: rgba(247, 147, 26, 0.08);
    border-radius: 10px;
    color: var(--accent-orange);
    font-weight: 500;
}

.payment-status .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.payment-status.success {
    background: rgba(34, 197, 94, 0.08);
    color: var(--accent-green);
}

/* Share Link */
.share-link {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.share-link input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--accent-blue);
    font-size: 0.875rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    transition: all 0.2s;
}

.share-link input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Note/Info Box */
.note {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.08) 0%, rgba(247, 147, 26, 0.03) 100%);
    padding: 16px;
    border-radius: 10px;
    border-left: 3px solid var(--accent-orange);
    line-height: 1.5;
}

/* Download Section */
#download-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

#start-download-btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

#save-file-btn {
    margin-top: 20px;
    width: 100%;
    padding: 16px;
}

/* Copy Button Feedback */
.copy-success {
    background: var(--accent-green) !important;
    color: white !important;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 20px 16px;
    }

    .logo-img {
        height: 40px;
    }

    .features {
        gap: 8px;
    }

    .feature {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .section {
        padding: 20px;
        border-radius: 12px;
    }

    .file-drop-zone {
        padding: 24px 16px;
    }

    .how-it-works {
        padding: 20px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .step-content h3 {
        font-size: 0.95rem;
    }

    .step-content p {
        font-size: 0.85rem;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 32px 20px;
    margin-top: 48px;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

footer a:hover {
    color: var(--text-secondary);
}
