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

:root {
    --bg-primary: #1f222a;
    --bg-surface: #2b2f3a;
    --bg-input: #181a20;
    --border-color: rgba(255, 255, 255, 0.12);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --accent-color: #818cf8;
    --accent-danger: #ef4444;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* Ambient glow background */
body::before,
body::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

body::before {
    background: #6366f1;
    top: -180px;
    left: -160px;
}

body::after {
    background: #ec4899;
    bottom: -180px;
    right: -160px;
}

.login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    padding: 2.75rem 2.25rem 2.25rem;
    background: rgba(43, 47, 58, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    animation: login-box-in 0.5s ease;
}

@keyframes login-box-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box .subtitle {
    margin: 0 0 1.75rem;
    padding: 0;
    color: var(--text-primary);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.field .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field .input-wrap > svg {
    position: absolute;
    left: 0.85rem;
    width: 17px;
    height: 17px;
    stroke: var(--text-secondary);
    pointer-events: none;
    transition: stroke 0.2s ease;
}

.field input {
    width: 100%;
    padding: 0.75rem 0.85rem 0.75rem 2.6rem;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
    color: #5b6272;
}

.field input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px var(--bg-input) inset;
}

.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px var(--bg-input) inset, 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.field input:autofill {
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
    box-shadow: 0 0 0 1000px var(--bg-input) inset;
}

.field input:focus ~ svg {
    stroke: var(--accent-color);
}

.field.password .input-wrap input {
    padding-right: 2.6rem;
}

.toggle-visibility {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.toggle-visibility:hover {
    color: var(--text-primary);
}

.toggle-visibility svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.8rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--accent-glow);
    background-size: 200% auto;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-position 0.4s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.login-submit:hover {
    background-position: right center;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
}

.login-submit:active {
    transform: translateY(0);
}
