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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: #0a0b10;
    color: #f0f1f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 520px;
    padding: 24px;
    perspective: 1000px;
}

.login-card {
    background: rgba(17, 19, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 56px 60px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: cardEntry 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    transform: translateY(24px);
}

.login-card.has-error {
    animation: cardEntry 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               cardShake 0.5s ease 0.75s;
    border-color: rgba(251, 113, 133, 0.35);
}

@keyframes cardEntry {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 24px;
    font-weight: 700;
    color: #ff6b35;
    position: relative;
    box-shadow: 0 0 32px rgba(255, 107, 53, 0.2);
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.6), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.brand p {
    color: #8a8f9f;
    font-size: 14px;
    line-height: 1.5;
}

.error-message {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.35);
    border-radius: 12px;
    color: #fb7185;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.error-message.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: errorShake 0.45s ease;
}

.error-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

@keyframes cardShake {
    0%, 100% { transform: translateY(0) translateX(0); }
    15% { transform: translateY(0) translateX(-6px); }
    30% { transform: translateY(0) translateX(6px); }
    45% { transform: translateY(0) translateX(-4px); }
    60% { transform: translateY(0) translateX(4px); }
    75% { transform: translateY(0) translateX(-2px); }
}

.login-form {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #8a8f9f;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-wrapper {
    position: relative;
    background: rgba(10, 11, 16, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.input-wrapper input {
    width: 100%;
    padding: 16px 18px;
    background: transparent;
    border: none;
    color: #f0f1f5;
    font-size: 16px;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #5a6070;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8f5a 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
}

.btn-primary:hover::before {
    left: 100%;
}

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

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #5a6070;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 16px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 12px;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn-oauth:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.oauth-icon {
    width: 24px;
    height: 24px;
    background: rgba(0, 212, 255, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    font-weight: 700;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #5a6070;
}

.login-footer a {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #4ce0ff;
}

@media (max-width: 560px) {
    .login-container {
        padding: 16px;
    }
    .login-card {
        padding: 40px 28px;
    }
    .brand h1 {
        font-size: 20px;
    }
}
