:root {
    --primary-dark: #003d99;
    --primary: #0066cc;
    --primary-light: #00b4ff;
    --text-dark: #0f2d5c;
    --text-body: #334155;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-bg: #f8fafc;
    --icon-user-bg: #dbeafe;
    --icon-user-color: #2563eb;
    --icon-lock-bg: #ede9fe;
    --icon-lock-color: #6366f1;
    --badge-bg: #0066cc;
    --shadow-card: 0 24px 48px rgba(0, 30, 80, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0047ab;
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 28px;
    gap: 28px;
}

/* Login card */
.login-card {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 40px 42px 36px;
    animation: cardEnter 0.55s ease-out;
}

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

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-uhm {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
    background: transparent;
    filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.2));
}

.academic-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--badge-bg);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    margin-bottom: 14px;
    line-height: 1.2;
}

.login-title {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.login-subtitle {
    margin: 0 0 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

.login-institution {
    margin: 0 0 18px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    line-height: 1.4;
}

.header-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 16px;
    max-width: 280px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider-cap {
    font-size: 0.875rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.login-description {
    margin: 0 auto;
    max-width: 320px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-body);
}

.input-group-custom {
    position: relative;
    display: flex;
    align-items: stretch;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-group-custom:focus-within {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.input-icon-box--user {
    background: var(--icon-user-bg);
    color: var(--icon-user-color);
}

.input-icon-box--lock {
    background: var(--icon-lock-bg);
    color: var(--icon-lock-color);
}

.form-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 14px 14px 14px 0;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-body);
    outline: none;
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-group-custom .form-input {
    padding-right: 44px;
}

.input-group-custom:not(:has(.toggle-password)) .form-input {
    padding-right: 14px;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

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

/* Login button */
.btn-login {
    width: 100%;
    margin-top: 8px;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #0052cc 0%, #0099ff 55%, #00c8ff 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(0, 82, 204, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 82, 204, 0.42);
    filter: brightness(1.04);
}

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

.btn-login i {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Page footer (outside card) */
.page-footer {
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 20, 60, 0.45);
    max-width: 520px;
}

.page-footer__copyright {
    margin: 0 0 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.page-footer__address {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    opacity: 0.95;
}

.page-footer__address i {
    font-size: 0.875rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .login-page {
        padding: 20px 16px 24px;
        gap: 22px;
    }

    .login-card {
        padding: 32px 24px 28px;
        border-radius: 20px;
    }

    .logo-wrap,
    .logo-uhm {
        width: 80px;
        height: 80px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .page-footer__address {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
}

@media (max-height: 720px) {
    .login-page {
        justify-content: flex-start;
        padding-top: 24px;
    }
}
