:root {
    --primary: #0d6efd;
    --primary-dark: #0755c7;
    --primary-light: #e8f3ff;
    --background: #edf6ff;
    --surface: #ffffff;
    --text: #172033;
    --muted: #718096;
    --border: #dbe7f3;
    --danger: #dc3545;
    --shadow: 0 18px 45px rgba(31, 94, 160, 0.16);
}

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

body {
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, #cce7ff 0, transparent 38%),
        linear-gradient(145deg, #eaf5ff, #f8fbff);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.login-page {
    width: min(100%, 460px);
    min-height: 100vh;
    margin: auto;
    padding: 42px 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.logo {
    width: 78px;
    height: 78px;
    margin: auto;
    display: grid;
    place-items: center;
    border-radius: 24px;
    color: white;
    background: linear-gradient(145deg, #0d6efd, #42a5f5);
    box-shadow: 0 14px 30px rgba(13, 110, 253, 0.28);
    font-size: 40px;
    font-weight: 800;
}

.brand-section h1 {
    margin-top: 16px;
    color: var(--primary);
    font-size: 36px;
    line-height: 1;
}

.brand-section p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 15px;
}

.login-card {
    padding: 27px 23px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.card-header {
    margin-bottom: 24px;
    text-align: center;
}

.card-header h2 {
    font-size: 25px;
}

.card-header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 650;
}

.input-box {
    height: 54px;
    display: flex;
    align-items: center;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: 0.2s;
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.input-icon {
    width: 48px;
    text-align: center;
    font-size: 20px;
}

.input-box input {
    min-width: 0;
    flex: 1;
    height: 100%;
    padding-right: 12px;
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
}

.input-box input::placeholder {
    color: #a6b2c2;
}

.password-toggle {
    width: 48px;
    height: 100%;
    background: transparent;
    border: none;
    font-size: 19px;
}

.login-options {
    margin: 2px 2px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #4b586a;
    font-size: 13px;
    cursor: pointer;
}

.remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

.forgot-button {
    color: var(--primary);
    background: transparent;
    border: none;
    font-size: 13px;
}

.login-button {
    width: 100%;
    height: 54px;
    color: white;
    background: linear-gradient(135deg, var(--primary), #3ea6ff);
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(13, 110, 253, 0.25);
    font-size: 17px;
    font-weight: 700;
    transition: 0.2s;
}

.login-button:hover {
    transform: translateY(-1px);
}

.login-button:active {
    transform: scale(0.98);
}

.error-message {
    min-height: 20px;
    margin-bottom: 8px;
    color: var(--danger);
    font-size: 13px;
    text-align: center;
}

.demo-box {
    margin-top: 22px;
    padding: 14px;
    color: #496077;
    background: var(--primary-light);
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.demo-title {
    margin-bottom: 2px;
    color: var(--primary-dark);
    font-weight: 700;
}

.footer {
    margin-top: 24px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

@media (max-width: 480px) {
    .login-page {
        padding-top: 28px;
        justify-content: flex-start;
    }

    .logo {
        width: 68px;
        height: 68px;
        border-radius: 21px;
        font-size: 35px;
    }

    .brand-section h1 {
        font-size: 32px;
    }

    .login-card {
        padding: 24px 19px;
        border-radius: 24px;
    }
}

/* Version 0.7.4: Role selector and separated admin portal */
.role-selector {
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    border: 0;
}
.role-selector legend { width: 100%; margin-bottom: 9px; font-size: 14px; font-weight: 650; }
.role-option {
    min-height: 72px;
    padding: 9px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #536274;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 15px;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: 0.2s;
}
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option.active { color: var(--primary-dark); background: var(--primary-light); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.08); }
.role-icon { font-size: 24px; line-height: 1; }
.input-hint { margin: 7px 3px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.admin-login-body { background: radial-gradient(circle at top left, #dce8f5 0, transparent 38%), linear-gradient(145deg, #eef3f8, #ffffff); }
.admin-brand .logo { background: linear-gradient(145deg, #26384c, #4d6a87); }
.admin-brand h1 { color: #26384c; font-size: 31px; }
.admin-login-card { border-top: 5px solid #26384c; }
.admin-security-badge { width: fit-content; margin: -10px auto 18px; padding: 7px 12px; color: #334a61; background: #e9f0f7; border-radius: 999px; font-size: 12px; font-weight: 700; }
.admin-login-button { background: linear-gradient(135deg, #26384c, #4d6a87); box-shadow: 0 10px 22px rgba(38,56,76,.25); }
.back-to-app { display: block; margin-top: 20px; color: #526a82; font-size: 13px; text-align: center; text-decoration: none; }
@media (max-width: 480px) { .role-selector { grid-template-columns: repeat(2, 1fr); gap: 6px; } .role-option { font-size: 12px; } }
