/* ============================================================
   Wallet Custom — Solana Custom Address Generator
   Theme matching wallet-rescue (dark, cyan/green neon, glass)
   ============================================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0d1117;
    --bg-card: rgba(15, 20, 30, 0.7);
    --border-card: rgba(0, 245, 255, 0.12);

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;

    --accent-cyan: #00f5ff;
    --accent-green: #00ff88;
    --accent-orange: #ff9500;
    --accent-red: #ff4757;
    --accent-blue: #58a6ff;

    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(145deg, var(--bg-primary) 0%, var(--bg-secondary) 100%) fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    zoom: 0.8;
}

code, .mono {
    font-family: 'JetBrains Mono', monospace;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20.5px 40px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-card);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 20px; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.by-label {
    font-size: 15px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.by-label a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.2s;
}
.by-label a:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* ---- STEPS BAR ---- */
.steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 32px;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.35;
    transition: opacity 0.3s;
}
.step.active { opacity: 1; }
.step.done { opacity: 0.7; }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 1px solid var(--text-muted);
    transition: all 0.3s;
}

.step.active .step-num {
    background: rgba(0, 245, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.3);
}

.step.done .step-num {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.step.active .step-label { color: var(--text-primary); }

.step-line {
    flex: 1;
    height: 1px;
    background: var(--text-muted);
    margin: 0 12px;
    min-width: 24px;
}

.hidden { display: none !important; }

/* ---- CONTENT ---- */
.content {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

/* ---- CARD (GLASS) ---- */
.card.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.card-desc code {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* ---- FORM ---- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-row {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    transition: border-color 0.2s;
}
.input-row:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.08);
}

.input-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    padding: 12px 4px;
    letter-spacing: 0.5px;
}

.input-prefix {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    margin-right: 2px;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.input-hint {
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}
.input-hint.error { color: var(--accent-red); }
.input-hint.success { color: var(--accent-green); }

/* ---- INFO BOX ---- */
.info-box {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(0, 245, 255, 0.04);
    border: 1px solid rgba(0, 245, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

.info-box code {
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent-orange);
}

.info-icon {
    font-size: 12px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 245, 255, 0.12);
    color: var(--accent-cyan);
    font-weight: 700;
    font-style: italic;
    font-family: serif;
    margin-top: 1px;
}

.info-telegram {
    background: rgba(0, 245, 255, 0.04);
    border-color: rgba(0, 245, 255, 0.12);
    margin-top: 24px;
}

/* ---- DIFFICULTY BOX ---- */
.difficulty-box {
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.diff-header {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diff-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.diff-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
    width: 0%;
}

.diff-bar.easy { width: 15%; background: var(--accent-green); }
.diff-bar.medium { width: 40%; background: var(--accent-cyan); }
.diff-bar.hard { width: 65%; background: var(--accent-orange); }
.diff-bar.extreme { width: 90%; background: var(--accent-red); }

.diff-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-cyan), #00c8ff);
    color: #000;
    padding: 14px 24px;
    font-size: 15px;
}
.btn-primary:not(:disabled):hover {
    box-shadow: 0 0 24px rgba(0, 245, 255, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    margin-top: 16px;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-back {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
}
.btn-back:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ---- SECURITY NOTICE ---- */
.security-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 149, 0, 0.04);
    border: 1px solid rgba(255, 149, 0, 0.12);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
}

/* ---- FAQ ---- */
.faq-section {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    border: 1px solid var(--border-card);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transition: border-color 0.25s;
}
.faq-item:hover {
    border-color: rgba(0, 255, 200, 0.2);
}
.faq-item.open {
    border-color: rgba(0, 255, 200, 0.25);
    background: rgba(0, 255, 200, 0.03);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    outline: none;
}
.faq-question:hover {
    color: var(--accent-cyan);
}

.faq-chevron {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: var(--accent-cyan);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 20px;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 20px 16px;
}

.faq-answer p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 8px;
}
.faq-answer p:last-child {
    margin-bottom: 0;
}
.faq-answer strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* ---- STEP 2: VERIFY ---- */
.verify-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

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

.verify-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 245, 255, 0.12);
    border: 1px solid rgba(0, 245, 255, 0.3);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.verify-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.bot-link {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 14px;
    background: rgba(0, 245, 255, 0.08);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-cyan);
    transition: all 0.2s;
}
.bot-link:hover {
    background: rgba(0, 245, 255, 0.14);
    text-decoration: none;
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.15);
}

.code-display {
    margin-top: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 245, 255, 0.15);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 8px;
    color: var(--accent-cyan);
    text-align: center;
    user-select: all;
}

.code-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.verify-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(0, 245, 255, 0.04);
    border: 1px solid rgba(0, 245, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.verify-status.verified {
    background: rgba(0, 255, 136, 0.06);
    border-color: rgba(0, 255, 136, 0.15);
    color: var(--accent-green);
}

/* ---- STEP 3: GRINDING ---- */
.grind-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
}

.grind-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(0, 245, 255, 0.12);
    border-top-color: var(--accent-cyan);
    animation: spin 0.8s linear infinite;
}

.grind-text {
    font-size: 14px;
    color: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

.grind-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.grind-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
}

.grind-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grind-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.grind-stat-value.mono {
    font-family: 'JetBrains Mono', monospace;
}

.status-active {
    color: var(--accent-cyan);
    animation: pulse 2s ease-in-out infinite;
}

/* ---- STEP 4: DONE ---- */
.result-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    word-break: break-all;
    color: var(--accent-green);
    text-align: center;
}

.done-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 24px 0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.check-item.done {
    background: rgba(0, 255, 136, 0.04);
    border: 1px solid rgba(0, 255, 136, 0.1);
    color: var(--accent-green);
}

.check-item.warning {
    background: rgba(255, 149, 0, 0.04);
    border: 1px solid rgba(255, 149, 0, 0.1);
    color: var(--accent-orange);
}

.check-icon {
    font-size: 16px;
    font-weight: 700;
}

/* ---- SPINNER ---- */
.spinner-small {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0, 245, 255, 0.15);
    border-top-color: var(--accent-cyan);
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ---- TOAST ---- */
#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(12px);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.success {
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid rgba(0, 255, 136, 0.25);
    color: var(--accent-green);
}
.toast.error {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.25);
    color: var(--accent-red);
}
.toast.info {
    background: rgba(0, 245, 255, 0.12);
    border: 1px solid rgba(0, 245, 255, 0.25);
    color: var(--accent-cyan);
}

/* ---- ANIMATIONS ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    body { zoom: 1; }
    .header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .logo { font-size: 18px; }
    .logo-sub { display: none; }
    .content { padding: 0 16px 32px; }
    .card.glass { padding: 24px 18px; }
    .steps-bar { padding: 16px; gap: 0; }
    .step-label { display: none; }
    .grind-info { grid-template-columns: 1fr; }
    .code-display { font-size: 22px; letter-spacing: 6px; }
}

@media (max-width: 480px) {
    .card.glass { padding: 20px 14px; }
    .card h2 { font-size: 17px; }
    .input-row input { font-size: 14px; }
    .code-display { font-size: 20px; letter-spacing: 4px; }
}
