@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #080a0f;
    --bg-secondary: #0e1018;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --accent: #00f0ff;
    --accent-secondary: #5d6af7;
    --accent-hover: #00d4e0;
    --accent-glow: rgba(0, 240, 255, 0.25);
    --accent-glow-soft: rgba(93, 106, 247, 0.15);
    --text-primary: #f0f0f8;
    --text-secondary: #8b8fa8;
    --text-muted: #3e4260;
    --border: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(0, 240, 255, 0.3);
    --border-focus: rgba(0, 240, 255, 0.6);
    --error: #ff4b6e;
    --success: #00e89d;
    --shadow-card: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 240, 255, 0.05);
    --radius: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--bg-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ── Animated mesh background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 15% -10%, rgba(0, 240, 255, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 70% 80% at 85% 110%, rgba(93, 106, 247, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(20, 25, 50, 0.6) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Floating orb 1 ── */
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.05) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    pointer-events: none;
    z-index: 0;
    animation: floatOrb 10s ease-in-out infinite;
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { transform: translateY(40px) scale(1.08); opacity: 1; }
}

/* ── Grid overlay ── */
.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

/* ── Auth Panel Layout ── */
.front-panel-anchor {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.front-panel {
    background: rgba(12, 14, 22, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
    width: 100%;
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    list-style-type: none;
    animation: slideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
}

/* Top accent glow line */
.front-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.6), transparent);
    z-index: 1;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Banner / Nav ── */
.front-panel .banner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.018);
}

.banner-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.banner-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0, 240, 255, 0.4);
    animation: pulseDot 2.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.banner-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.front-panel .banner > a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 6px 14px;
    border-radius: 7px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    background: transparent;
}

.front-panel .banner > a:hover {
    color: var(--accent);
    border-color: var(--border-accent);
    background: rgba(0, 240, 255, 0.06);
}

/* ── Logo ── */
.ashes-logo {
    display: block;
    margin: 30px auto 22px;
    width: 68px;
    height: 68px;
    border-radius: 18px;
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.2), 0 8px 32px rgba(0, 240, 255, 0.2), 0 2px 8px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ashes-logo:hover {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.4), 0 12px 40px rgba(0, 240, 255, 0.35), 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Panel heading ── */
.panel-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.panel-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-weight: 400;
}

/* ── Form Layout ── */
.front-panel > form {
    margin: 0;
}

.input-field-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 26px 26px;
    list-style: none;
}

.input-field-container > li {
    list-style: none;
    width: 100%;
    position: relative;
}

/* ── Input Labels ── */
.field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* ── Input Wrapper (for icon + toggle) ── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 13px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

/* ── Input Fields ── */
.input-field {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    padding: 12px 16px 12px 40px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    outline: none;
    transition: all 0.22s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-field.no-icon {
    padding-left: 16px;
}

.input-field.has-toggle {
    padding-right: 44px;
}

.input-field::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

.input-field:focus {
    border-color: var(--border-focus);
    background: rgba(0, 240, 255, 0.04);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Password Toggle ── */
.pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.pw-toggle:hover {
    color: var(--accent);
}

/* ── Invite Token Field ── */
.token-field-wrapper {
    position: relative;
}

.token-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 2px 7px;
    border-radius: 4px;
    pointer-events: none;
}

/* ── Remember me ── */
.remember-password {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.remember-password input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.remember-password span {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ── Submit Button ── */
.signin-signout {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #00f0ff 0%, #0066ff 100%);
    border-radius: var(--radius-sm);
    color: #050508;
    border: none;
    cursor: pointer;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 240, 255, 0.35);
    margin-top: 4px;
}

.signin-signout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.signin-signout:hover {
    background: linear-gradient(135deg, #00d8e6 0%, #005ce6 100%);
    box-shadow: 0 6px 32px rgba(0, 240, 255, 0.55);
    transform: translateY(-1px);
}

.signin-signout:hover::before { opacity: 1; }

.signin-signout:active {
    transform: translateY(0);
    box-shadow: 0 2px 14px rgba(0, 240, 255, 0.3);
}

/* ── Divider ── */
.divider-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.divider-line::before,
.divider-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Info / Error Banner ── */
.login-info-banner {
    color: var(--error);
    font-size: 12px;
    font-weight: 500;
    min-height: 18px;
    text-align: center;
    letter-spacing: 0.01em;
    padding: 0 4px 6px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

/* ── Footer ── */
.footer {
    padding: 16px 22px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.012);
}

.footer > * > a,
.footer > a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer > * > a:hover,
.footer > a:hover {
    color: var(--accent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e3152; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }