:root {
    --black:    #050508;
    --deep:     #0a0a12;
    --purple:   #7B2FBE;
    --violet:   #5538C8;
    --magenta:  #D946EF;
    --pink:     #E879F9;
    --glow:     rgba(217, 70, 239, 0.35);
    --glow-v:   rgba(123, 47, 190, 0.4);
    --text:     #e8e0f5;
    --muted:    #7a6e8a;
    --border:   rgba(217, 70, 239, 0.2);
    --surface:  rgba(255,255,255,0.03);
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--black);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(123,47,190,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(217,70,239,0.14) 0%, transparent 55%),
        radial-gradient(ellipse 80% 80% at 50% 50%, rgba(10,8,20,0.9) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.08) 2px,
        rgba(0,0,0,0.08) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
}

.card {
    background: rgba(8, 6, 18, 0.92);
    border: 1px solid var(--border);
    border-radius: 4px;
    backdrop-filter: blur(24px);
    overflow: hidden;
    position: relative;
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--magenta), var(--purple), transparent);
}

.card::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 60px; height: 60px;
    border-right: 1px solid rgba(217,70,239,0.3);
    border-bottom: 1px solid rgba(217,70,239,0.3);
    border-radius: 0 0 4px 0;
}

.corner-tl {
    position: absolute;
    top: 0; left: 0;
    width: 60px; height: 60px;
    border-left: 1px solid rgba(217,70,239,0.3);
    border-top: 1px solid rgba(217,70,239,0.3);
    border-radius: 4px 0 0 0;
}

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

.header {
    padding: 40px 36px 32px;
    text-align: center;
    position: relative;
}

.logo-wrap {
    display: inline-block;
    position: relative;
    margin-bottom: 18px;
}

.logo-wrap img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(217,70,239,0.6)) drop-shadow(0 0 40px rgba(123,47,190,0.4));
    animation: pulse-logo 3s ease-in-out infinite;
}

@keyframes pulse-logo {
    0%, 100% { filter: drop-shadow(0 0 18px rgba(217,70,239,0.6)) drop-shadow(0 0 40px rgba(123,47,190,0.4)); }
    50%       { filter: drop-shadow(0 0 28px rgba(217,70,239,0.9)) drop-shadow(0 0 60px rgba(123,47,190,0.6)); }
}

.header-title {
    font-family: 'Oxanium', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--magenta);
    margin-bottom: 6px;
}

.header h1 {
    font-family: 'Oxanium', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.08em;
    line-height: 1.1;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 0 36px;
}

.body {
    padding: 32px 36px 36px;
}

.auth-desc {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 28px;
    font-weight: 400;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 26px;
    font-size: 13px;
}

.user-info .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--magenta);
    box-shadow: 0 0 8px var(--magenta);
    flex-shrink: 0;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}

.user-info .label {
    color: var(--muted);
    font-weight: 400;
}

.user-info .name {
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.input-wrap {
    position: relative;
}

.input-wrap::before {
    content: '';
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237B2FBE' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.7;
}

.field input {
    width: 100%;
    padding: 13px 14px 13px 40px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(123,47,190,0.3);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Oxanium', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    caret-color: var(--magenta);
}

.field input::placeholder {
    color: rgba(122,110,138,0.5);
    letter-spacing: 0.1em;
    font-weight: 300;
}

.field input:focus {
    outline: none;
    border-color: var(--magenta);
    background: rgba(217,70,239,0.05);
    box-shadow: 0 0 0 3px rgba(217,70,239,0.1), 0 0 20px rgba(217,70,239,0.08);
}

.field input:disabled {
    opacity: 0.4;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 4px;
    font-family: 'Oxanium', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn:hover::after { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, var(--purple) 0%, var(--violet) 50%, #4a30b0 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(123,47,190,0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(217,70,239,0.45);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-discord {
    background: linear-gradient(135deg, #5865F2, #404EED);
    color: #fff;
    box-shadow: 0 4px 20px rgba(88,101,242,0.35);
}

.btn-discord:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(88,101,242,0.5);
}

.btn-discord svg { flex-shrink: 0; }

#status-message {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    display: none;
    animation: fadein 0.25s ease;
}

#status-message.show { display: block; }

#status-message.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
}

#status-message.success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    color: #4ade80;
}

#status-message.loading {
    background: rgba(217,70,239,0.08);
    border: 1px solid rgba(217,70,239,0.25);
    color: var(--pink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(217,70,239,0.3);
    border-top-color: var(--magenta);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

#success-section {
    text-align: center;
    animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.success-glyph {
    width: 68px; height: 68px;
    border-radius: 50%;
    border: 1px solid rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.08);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 22px;
    font-size: 30px;
    box-shadow: 0 0 30px rgba(34,197,94,0.2);
}

#success-section h2 {
    font-family: 'Oxanium', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

#success-section p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
    line-height: 1.6;
}

#success-section .btn-discord { margin-top: 28px; }

.footer {
    padding: 14px 36px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-text {
    font-size: 11px;
    color: rgba(122,110,138,0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
}

.footer-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.footer-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

.hidden { display: none !important; }
