*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #29C214;
    --primary-dark: #22a010;
    --primary-glow: rgba(41, 194, 20, .18);
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1c1c1c;
    --border: #262626;
    --text: #f0f0f0;
    --muted: #5a5a5a;
    --muted-light:  #888;
    --radius: 12px;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    overflow: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(41,194,20,.12) 0%, transparent 70%);
    top: -120px;
    left: -120px;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(41,194,20,.08) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
}

.card {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 38px 34px;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 24px 60px rgba(0,0,0,.5);
    animation: cardIn .5s cubic-bezier(.22,.68,0,1.15) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 30px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.2px;
    color: var(--text);
    line-height: 1.2;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted-light);
    margin-top: 1px;
}

.tabs {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 24px;
    position: relative;
}

.tab-pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: left .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}

.tab-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--muted-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    z-index: 1;
    transition: color .18s;
}

.tab-btn.active { color: var(--text); }
.tab-btn:not(.active):hover { color: #bbb; }

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-light);
    margin-bottom: 6px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 13px;
    background: var(--bg);
    transition: border-color .18s, box-shadow .18s;
}

.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrap svg {
    flex-shrink: 0;
    color: var(--muted);
    margin-right: 9px;
    transition: color .18s;
}

.input-wrap:focus-within svg { color: var(--primary); }

.input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    padding: 12px 0;
}

.input-wrap input::placeholder { color: var(--muted); }

.toggle-pass {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 6px;
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color .18s;
    flex-shrink: 0;
}

.toggle-pass:hover { color: var(--muted-light); }

#appIdField {
    overflow: hidden;
    max-height: 80px;
    opacity: 1;
    transition: max-height .28s cubic-bezier(.4,0,.2,1), opacity .22s ease, margin-bottom .28s ease;
}

#appIdField.hidden-field {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--muted-light);
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color .15s, background .15s;
}

.remember input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.error-msg {
    background: rgba(220,38,38,.1);
    border: 1px solid rgba(220,38,38,.25);
    color: #f87171;
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake .32s ease;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .18s, box-shadow .18s, transform .1s;
    box-shadow: 0 2px 16px rgba(41,194,20,.25);
}

.btn-login:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 24px rgba(41,194,20,.38);
}

.btn-login:active { transform: scale(.98); }

.divider {
    height: 1px;
    background: var(--border);
    margin: 22px 0;
}
