/* core-engine — self-service signup flow styling */

:root {
    --primary: #6D5FF0;
    --primary-2: #8B5CF6;
    --success: #10B981;
    --success-2: #22C55E;
    --danger: #EF4444;
    --text: #1E1B3A;
    --text-muted: #64748B;
    --border: #E7E9F2;
    --radius: 20px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
body.bg-signup {
    background: linear-gradient(135deg, #5B6EF5 0%, #7C5CF0 50%, #9B5CF0 100%);
}
body.bg-processing {
    background: linear-gradient(135deg, #0F2A3D 0%, #16374D 50%, #1B4055 100%);
}
body.bg-success {
    background: linear-gradient(135deg, #0FA968 0%, #22C55E 50%, #34D399 100%);
    overflow: hidden;
    position: relative;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Stepper ---------- */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.step-pill {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 30px;
    font-size: 12.5px; font-weight: 700;
    background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.75);
    white-space: nowrap;
}
.step-pill svg { width: 15px; height: 15px; }
.step-pill.active { background: #fff; color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.step-pill.done { background: rgba(255,255,255,0.28); color: #fff; }
.step-line { width: 26px; height: 2px; background: rgba(255,255,255,0.35); border-radius: 2px; }

/* ---------- Card ---------- */
.card-wrap { width: 100%; max-width: 560px; }
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    padding: 40px;
}
.card-header { text-align: center; margin-bottom: 26px; }
.card-header .card-icon { font-size: 26px; margin-bottom: 10px; }
.card-header .card-icon svg { width: 40px; height: 40px; color: var(--primary); }
.card-header h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; display:flex; align-items:center; justify-content:center; gap:9px; }
.card-header p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---------- Form ---------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 7px; color: var(--text); }
.field label .req { color: var(--danger); }
.field label .opt { color: var(--text-muted); font-weight: 500; }
.input-icon { position: relative; }
.input-icon svg {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--primary); opacity: 0.75;
}
.input-icon input {
    width: 100%; padding: 12px 14px 12px 38px; border-radius: 12px;
    border: 1.5px solid var(--border); font-size: 14px; font-family: inherit;
    background: #F8F9FF; color: var(--text); transition: border-color 150ms, background 150ms;
}
.input-icon input:focus {
    outline: none; border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 4px rgba(109, 95, 240, 0.12);
}
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 5px; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn-gradient {
    width: 100%; padding: 15px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 10px 24px rgba(109, 95, 240, 0.35);
    transition: transform 150ms, box-shadow 150ms;
}
.btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(109, 95, 240, 0.42); }
.btn-gradient:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-gradient svg { width: 17px; height: 17px; }

.btn-green { background: linear-gradient(135deg, var(--success), var(--success-2)); box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35); }
.btn-green:hover { box-shadow: 0 14px 30px rgba(16, 185, 129, 0.42); }

.btn-outline-green {
    background: #fff; color: var(--success); border: 2px solid var(--success);
    box-shadow: none;
}
.btn-outline-green:hover { background: #F0FDF7; transform: translateY(-1px); }

.btn-row { display: flex; gap: 12px; }
.back-link { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.back-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.back-link:hover { color: var(--primary); }

/* ---------- Payment page ---------- */
.qr-box {
    width: 220px; height: 220px; margin: 0 auto 14px;
    border: 2px solid var(--border); border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    padding: 10px; background: #fff;
}
.qr-box canvas, .qr-box img { width: 100%; height: 100%; }
.pay-amount { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.upi-pill {
    display: block; text-align: center; margin: 0 auto 26px;
    background: #F1EEFF; color: var(--primary); font-weight: 700; font-size: 12.5px;
    padding: 6px 14px; border-radius: 20px; width: fit-content;
}
.utr-box {
    background: #F8F9FF; border: 1.5px solid var(--border); border-radius: 14px;
    padding: 14px 16px; margin-bottom: 20px;
}
.utr-box label { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.utr-box label svg { width: 15px; height: 15px; color: var(--primary); }
.utr-box input {
    width: 100%; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--border);
    font-size: 14px; background: #fff; font-family: inherit;
}
.utr-box .hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ---------- Processing (creating.php) ---------- */
.processing-card {
    background: rgba(255,255,255,0.06); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px; padding: 40px; color: #fff;
    width: 100%; max-width: 460px; text-align: center;
}
.processing-card h1 { font-size: 19px; margin: 0 0 20px; }
.progress-track { height: 8px; border-radius: 8px; background: rgba(255,255,255,0.14); overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; width: 0%; border-radius: 8px; background: linear-gradient(90deg, var(--success), var(--success-2)); transition: width 400ms ease; }
.progress-pct { font-size: 13px; font-weight: 700; margin-bottom: 22px; opacity: 0.9; }
.step-list { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.step-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.45);
    transition: background 250ms, color 250ms;
}
.step-item.done { background: rgba(16, 185, 129, 0.18); color: #6EE7B7; }
.step-item .check { width: 16px; height: 16px; flex-shrink: 0; visibility: hidden; }
.step-item.done .check { visibility: visible; }
.step-item .spin { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; visibility: hidden; flex-shrink:0; }
.step-item.active .spin { visibility: visible; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-error {
    margin-top: 20px; padding: 14px 16px; border-radius: 12px;
    background: rgba(239, 68, 68, 0.18); color: #FCA5A5; font-size: 12.5px; text-align: left;
}

/* ---------- Success page ---------- */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span {
    position: absolute; top: -20px; border-radius: 2px; opacity: 0.85;
    animation: fall linear infinite;
}
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }

.success-card { position: relative; z-index: 2; }
.success-badge {
    width: 64px; height: 64px; border-radius: 50%;
    background: #fff; color: var(--success);
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: -32px; left: 32px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.success-badge svg { width: 30px; height: 30px; }
.success-card .card { padding-top: 48px; }
.success-header { text-align: center; margin-bottom: 24px; }
.success-header h1 { font-size: 21px; font-weight: 800; margin: 0 0 4px; display:flex; align-items:center; justify-content:center; gap:8px;}
.success-header p { font-size: 13px; color: var(--text-muted); margin: 0; }

.copy-field { margin-bottom: 14px; }
.copy-field label {
    display: flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 6px;
}
.copy-field label svg { width: 13px; height: 13px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
    flex: 1; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--border);
    background: #F8F9FF; font-size: 13px; font-family: monospace; color: var(--text);
}
.copy-btn {
    width: 42px; flex-shrink: 0; border: none; border-radius: 10px;
    background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center;
    transition: background 150ms;
}
.copy-btn svg { width: 17px; height: 17px; }
.copy-btn:hover { background: #0D9F6E; }
.copy-btn.copied { background: #0D9F6E; }

.cred-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 480px) { .cred-row { grid-template-columns: 1fr; } }

.whatsapp-btn {
    width: 100%; margin-top: 14px; padding: 14px; border: none; border-radius: 14px;
    background: #25D366; color: #fff; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.whatsapp-btn svg { width: 18px; height: 18px; }
.whatsapp-btn:hover { background: #20BD5A; }
.wa-hint { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 10px; }

.toast-mini {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--text); color: #fff; padding: 10px 18px; border-radius: 30px;
    font-size: 12.5px; font-weight: 600; opacity: 0; transition: all 220ms; z-index: 999;
}
.toast-mini.show { opacity: 1; transform: translateX(-50%) translateY(0); }
