* {
    box-sizing: border-box;
}
body.login-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: none !important;
    background-image: none !important;
    min-height: 100vh;
    overflow: hidden;
}
.login-root {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.login-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(0,0,0,0.45);
    z-index: 1;
}
.dark .login-overlay {
    background: rgba(0,0,0,0.6);
}
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 24px;
    background: hsl(var(--bg) / 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid hsl(var(--border) / 0.5);
    box-shadow: 0 1px 8px var(--shadow);
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.nav-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.nav-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: hsl(var(--navbar-fg));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid hsl(var(--border) / 0.5);
    background: hsl(var(--card) / 0.3);
    color: hsl(var(--navbar-fg));
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
    background: hsl(var(--card) / 0.5);
    transform: scale(1.05);
}
.theme-toggle-btn:active {
    transform: scale(0.95);
}
.theme-toggle-btn:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
}
.theme-toggle-btn .sun-icon {
    display: none;
    color: #f59e0b;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
}
.theme-toggle-btn .moon-icon {
    display: block;
    color: #64748b;
}
html.dark .theme-toggle-btn .sun-icon {
    display: block;
}
html.dark .theme-toggle-btn .moon-icon {
    display: none;
}
.login-wrapper {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 88px 20px 80px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: hsl(var(--bg) / 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid hsl(var(--border) / 0.4);
    border-radius: 32px;
    padding: 40px 36px;
    box-shadow: 0 25px 50px -12px var(--shadow), 0 0 0 1px hsl(var(--border) / 0.1);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.login-card:has(.manual-link),
.login-card.has-manual-link {
    padding-bottom: 24px;
}
.login-card-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-card-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: hsl(var(--fg));
}
.login-card-header p {
    margin: 8px 0 0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: hsl(var(--muted-fg));
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: hsl(var(--muted-fg));
    margin-bottom: 6px;
    margin-left: 4px;
}
.form-group select,
.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    color: hsl(var(--fg));
    background: hsl(var(--bg) / 0.6);
    border: 1.5px solid hsl(var(--border));
    border-radius: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
    height: auto;
    -webkit-appearance: none;
    appearance: none;
}
.form-group select:focus,
.form-group input:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.12);
}
.form-group select:hover,
.form-group input:hover {
    border-color: hsl(var(--muted-fg) / 0.4);
}
.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.dark .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
.password-input-wrapper {
    position: relative;
}
.password-input-wrapper input {
    padding-right: 44px !important;
}
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: hsl(var(--muted-fg));
    font-size: 16px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    z-index: 10;
}
.password-toggle:hover {
    color: hsl(var(--primary));
}
.login-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}
.login-actions .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
}
.btn-login {
    background: hsl(var(--primary));
    color: hsl(var(--primary-fg));
    box-shadow: 0 8px 24px hsl(var(--primary) / 0.25);
}
.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px hsl(var(--primary) / 0.3);
}
.btn-login:active {
    transform: scale(0.98);
}
.btn-signup {
    display: none;
    background: hsl(var(--card) / 0.5);
    color: hsl(var(--fg));
    border: 1.5px solid hsl(var(--border)) !important;
}
.btn-signup:hover {
    background: hsl(var(--card) / 0.8);
    border-color: hsl(var(--primary) / 0.4) !important;
}
.manual-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: hsl(var(--muted-fg)) !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    outline: none !important;
}
.manual-link:hover,
.manual-link:focus,
.manual-link:focus-visible {
    color: hsl(var(--primary)) !important;
    text-decoration: underline !important;
    outline: none !important;
}
.manual-link:hover .manual-icon {
    transform: translateY(1px);
}
.manual-link:visited {
    color: hsl(var(--muted-fg)) !important;
}
.manual-link .manual-icon {
    flex-shrink: 0;
    color: currentColor;
    transition: transform 0.2s ease;
}
.btn-forgot {
    background: transparent;
    color: hsl(var(--muted-fg));
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    border: none;
    padding: 8px 0;
    transition: color 0.2s ease;
    font-family: inherit;
    width: 100%;
    text-align: center;
    margin-top: 16px;
}
.btn-forgot:hover {
    color: hsl(var(--primary));
}
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    height: 56px;
    background: hsl(var(--bg) / 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid hsl(var(--border) / 0.4);
}
.login-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: hsl(var(--muted-fg));
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}
.login-footer a:focus,
.login-footer a:focus-visible,
.login-footer a:active,
.login-footer a:visited {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.login-footer a:hover {
    color: hsl(var(--primary));
}
.login-footer a img {
    height: 22px;
    width: auto;
    border: none !important;
    outline: none !important;
}
html.dark .login-footer a img {
    filter: invert(1);
}
.login-footer a p {
    margin: 0;
}
#frlogin {
    display: block;
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: hsl(var(--muted-fg));
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
#frlogin:hover {
    color: hsl(var(--primary));
}
@media (max-width: 480px) {
    .top-navbar {
        padding: 0 16px;
        height: 56px;
    }
    .nav-title {
        font-size: 14px;
    }
    .nav-logo {
        height: 30px;
    }
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
    }
    .login-card {
        padding: 28px 24px;
        border-radius: 24px;
    }
    .login-card:has(.manual-link),
    .login-card.has-manual-link {
        padding-bottom: 18px;
    }
    .login-card-header h2 {
        font-size: 22px;
    }
    .login-wrapper {
        padding: 76px 16px 68px;
    }
    .login-actions {
        flex-direction: column;
    }
}
@media (max-width: 768px) {
    .login-card {
        max-width: 380px;
    }
}
