/* ========================================================
   main.css  —  Public UI  (mobile-first, glassmorphism)
   ======================================================== */

/* ── Reset & Tokens ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:             #09090f;
    --accent-a:       #7c3aed;
    --accent-b:       #4f46e5;
    --accent-c:       #0ea5e9;
    --glass-bg:       rgba(255, 255, 255, 0.04);
    --glass-border:   rgba(255, 255, 255, 0.09);
    --glass-hi:       rgba(255, 255, 255, 0.07);
    --text-100:       #f8fafc;
    --text-400:       #94a3b8;
    --text-600:       #64748b;
    --success:        #22c55e;
    --error:          #ef4444;
    --radius-card:    24px;
    --radius-btn:     14px;
    --radius-box:     14px;
    --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ───────────────────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-100);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* ── Animated Background Orbs ────────────────────────── */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.14;
    will-change: transform;
}

.orb-1 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, var(--accent-a), transparent);
    top: -160px; left: -120px;
    animation: drift 9s ease-in-out infinite;
}

.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--accent-b), transparent);
    bottom: -120px; right: -80px;
    animation: drift 11s ease-in-out infinite reverse;
}

.orb-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, var(--accent-c), transparent);
    top: 50%; left: 55%;
    animation: drift 7s ease-in-out infinite 3s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    33%       { transform: translate(22px, -18px); }
    66%       { transform: translate(-12px, 14px); }
}

/* ── Layout ─────────────────────────────────────────── */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    padding: 20px;
}

/* ── Glass Card ──────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 1px 0 var(--glass-hi) inset,
        0 30px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.card-header {
    padding: 40px 40px 0;
    text-align: center;
}

.logo-icon {
    display: block;
    font-size: 52px;
    margin-bottom: 14px;
    animation: float-icon 4s ease-in-out infinite;
    user-select: none;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-6px); }
}

h1 {
    font-size: clamp(1.35rem, 5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(130deg, #c4b5fd 0%, #818cf8 60%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-400);
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.6;
    padding-bottom: 2px;
}

.card-body {
    padding: 28px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Primary Button ──────────────────────────────────── */
.btn-primary {
    position: relative;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-btn);
    background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.45);
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.55);
}

.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* Loading state */
.btn-loader {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.55s linear infinite;
    flex-shrink: 0;
}

.btn-primary.loading .btn-icon,
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .btn-loader { display: block; }

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

/* ── Comment Area ─────────────────────────────────────── */
.comment-area { animation: slide-up 0.38s cubic-bezier(0.16, 1, 0.3, 1); }
.comment-area.hidden { display: none; }

@keyframes slide-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.comment-box {
    position: relative;
    background: rgba(124, 58, 237, 0.07);
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: var(--radius-box);
    padding: 22px 24px;
    margin-bottom: 14px;
    overflow: hidden;
}

.comment-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167,139,250,0.4), transparent);
}

.comment-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 10px;
}

.comment-text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-100);
    word-break: break-word;
}

/* ── Action Row ───────────────────────────────────────── */
.action-row { display: flex; gap: 12px; }

.btn-secondary {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.09);
    color: #a78bfa;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: rgba(124, 58, 237, 0.18);
    border-color: rgba(124, 58, 237, 0.55);
    transform: translateY(-1px);
}

.btn-secondary.copied {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.btn-ghost {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-400);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-ghost:hover {
    background: var(--glass-hi);
    color: var(--text-100);
    transform: translateY(-1px);
}

/* ── Empty State ─────────────────────────────────────── */
.empty-message { text-align: center; padding: 30px 20px; animation: slide-up 0.32s ease; }
.empty-message.hidden { display: none; }
.empty-icon { font-size: 46px; margin-bottom: 14px; user-select: none; }
.empty-message p { color: var(--text-400); font-size: 0.92rem; line-height: 1.65; }

/* ── Toast ───────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 11px 22px;
    border-radius: 40px;
    font-size: 0.84rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    z-index: 999;
    transition: transform 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
    text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.3); color: #4ade80; }
.toast.error   { background: rgba(239,68,68,.14);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }

/* ── Footer ──────────────────────────────────────────── */
.footer {
    position: relative; z-index: 1;
    margin-top: 22px;
    text-align: center;
    padding-bottom: 10px;
}

.admin-link {
    color: var(--text-600);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    transition: color var(--transition);
}
.admin-link:hover { color: var(--text-400); }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .card-header { padding: 30px 24px 0; }
    .card-body   { padding: 22px 24px 30px; }
    .logo-icon   { font-size: 44px; }
    .action-row  { flex-direction: column; }
    .btn-secondary, .btn-ghost { padding: 14px; }
}
