* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

:root {
    --bg: #0a0a0f;
    --card: #15151d;
    --card-2: #1e1e28;
    --border: #2a2a38;
    --text: #e5e5ee;
    --muted: #8888a0;
    --primary: #7c5cff;
    --primary-hover: #6b4ce6;
    --green: #22c55e;
    --red: #ef4444;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(124, 92, 255, 0.12), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(124, 92, 255, 0.08), transparent 40%);
}

.app { width: 100%; max-width: 460px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.header { text-align: center; margin-bottom: 28px; }
.logo { font-size: 42px; margin-bottom: 8px; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }

.step { position: relative; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-badge {
    position: absolute; top: 0; right: 0;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(124, 92, 255, 0.15); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}

.step h2 { font-size: 18px; margin-bottom: 6px; }
.desc { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 18px; }
.desc b { color: var(--text); }

input, textarea {
    width: 100%; background: var(--card-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px; color: var(--text); font-size: 14.5px;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit; resize: vertical;
}

textarea { min-height: 80px; font-family: 'SF Mono', Monaco, monospace; font-size: 12.5px; line-height: 1.5; }

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

input::placeholder, textarea::placeholder { color: #55556b; }

.btn {
    width: 100%; border: none; border-radius: 12px; padding: 14px 20px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s;
    margin-top: 12px; display: flex; align-items: center; justify-content: center;
    gap: 8px; font-family: inherit;
}

.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn.ghost {
    background: transparent; color: var(--muted);
    border: 1px solid var(--border); font-size: 13px; padding: 10px; margin-top: 8px;
}
.btn.ghost:hover { color: var(--text); background: var(--card-2); }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: white;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

.result-icon { font-size: 52px; text-align: center; margin-bottom: 12px; }
#step3 h2 { text-align: center; font-size: 20px; margin-bottom: 8px; }
#step3 .desc { text-align: center; }

.result-box {
    background: var(--card-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px; margin: 16px 0 8px;
}

.row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; font-size: 13.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.row:last-child { border-bottom: none; }
.row span { color: var(--muted); }
.row b {
    font-weight: 600; font-family: 'SF Mono', Monaco, monospace;
    font-size: 12.5px; max-width: 60%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.row b.green { color: var(--green); }

.toast {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    background: var(--card-2); border: 1px solid var(--border);
    color: var(--text); padding: 10px 16px; border-radius: 10px;
    font-size: 13px; animation: slideDown 0.3s ease;
    max-width: 90%; text-align: center; z-index: 10;
}
.toast.error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.toast.success { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.api-info {
    margin-top: 24px; padding: 14px; background: var(--card-2);
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 12px; text-align: center;
}
.api-info p { color: var(--muted); margin-bottom: 8px; }
.api-info code {
    display: inline-block; background: var(--card); color: var(--primary);
    padding: 3px 8px; border-radius: 6px; margin: 2px;
    font-family: 'SF Mono', Monaco, monospace; font-size: 11px;
}
.api-info a { display: block; color: var(--primary); margin-top: 8px; text-decoration: none; font-weight: 600; }
.api-info a:hover { text-decoration: underline; }

.footer { text-align: center; color: #4a4a60; font-size: 11.5px; margin-top: 16px; }
