/*
 * Login form styles — Klaipėda University visual identity.
 * Used by views/login.vm and views/login-error.vm.
 * Other views (logout, error, consent) still use main.css.
 */

:root {
    --ku-blue:        #3039C8;
    --ku-blue-dark:   #262E9E;
    --ku-blue-soft:   #9198CA;
    --ku-blue-tint:   #EEF0FB;
    --ku-gold:        #D8A900;
    --ku-red:         #FF4933;
    --ku-red-tint:    #FFECE9;
    --ku-ink:         #141729;
    --ku-ink-muted:   #5A5F7A;
    --ku-line:        #D9DCEE;
    --ku-white:       #FFFFFF;
    --radius-lg:      20px;
    --radius-md:      12px;
    --radius-sm:      8px;
    --shadow-card:    0 24px 60px -20px rgba(48, 57, 200, 0.35),
                      0 8px 20px -8px rgba(20, 23, 41, 0.12);
    --font-sans:      "Space Grotesk", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

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

html, body {
    min-height: 100%;
    font-family: var(--font-sans);
    color: var(--ku-ink);
    background: var(--ku-blue-tint);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.brand-waves {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 42vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.brand-waves svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 32px;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    color: var(--ku-ink);
}
.brand-header img {
    height: 64px;
    width: auto;
    display: block;
}
.brand-header .brand-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.brand-header .brand-text p {
    font-size: 13px;
    font-weight: 500;
    color: var(--ku-ink-muted);
    margin-top: 2px;
}

.card {
    width: 100%;
    max-width: 440px;
    background: var(--ku-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 36px 36px 32px;
    position: relative;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}
.card-head h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.card-head p {
    font-size: 13px;
    color: var(--ku-ink-muted);
    margin-top: 4px;
}
.card-head .service-name {
    color: var(--ku-blue);
    font-weight: 600;
}

.lang-form { margin: 0; }
.lang-switch {
    display: inline-flex;
    background: var(--ku-blue-tint);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.lang-switch button {
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ku-ink-muted);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.04em;
}
.lang-switch button.active {
    background: var(--ku-white);
    color: var(--ku-blue);
    box-shadow: 0 1px 3px rgba(20, 23, 41, 0.08);
}

form.login-form { margin: 0; }

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ku-ink);
    margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--ku-line);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    color: var(--ku-ink);
    background: var(--ku-white);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input[type="text"]:focus,
.field input[type="password"]:focus {
    outline: 0;
    border-color: var(--ku-blue);
    box-shadow: 0 0 0 4px rgba(48, 57, 200, 0.12);
}
.field input::placeholder { color: #A6AAC2; }

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
    font-size: 13px;
    color: var(--ku-ink-muted);
    line-height: 1.45;
    cursor: pointer;
}
.check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--ku-line);
    border-radius: 5px;
    background: var(--ku-white);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all .15s ease;
}
.check input[type="checkbox"]:checked {
    background: var(--ku-blue);
    border-color: var(--ku-blue);
}
.check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid var(--ku-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.check input[type="checkbox"]:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(48, 57, 200, 0.18);
}

.btn-primary {
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 20px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--ku-blue);
    color: var(--ku-white);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
    box-shadow: 0 8px 18px -8px rgba(48, 57, 200, 0.6);
}
.btn-primary:hover { background: var(--ku-blue-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(48, 57, 200, 0.25),
                0 8px 18px -8px rgba(48, 57, 200, 0.6);
}
.btn-primary + .btn-primary { margin-top: 10px; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--ku-blue);
    border: 1.5px solid var(--ku-line);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-ghost:hover {
    border-color: var(--ku-blue);
    background: var(--ku-blue-tint);
}
.btn-ghost:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(48, 57, 200, 0.18);
}

.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.btn-row .btn-primary,
.btn-row .btn-ghost {
    flex: 1;
    min-width: 120px;
    margin-top: 0;
}

.content-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ku-ink);
}
.content-text + .content-text { margin-top: 12px; }
.content-text p + p { margin-top: 10px; }
.content-text strong { font-weight: 700; }

.service-list {
    list-style: none;
    margin-top: 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.service-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--ku-blue-tint);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--ku-ink);
    word-break: break-word;
}
.service-list li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ku-blue);
    flex-shrink: 0;
}

.card--wide { max-width: 520px; }

.card--error::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--ku-red);
}
.card--error { overflow: hidden; }

.error-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ku-red-tint);
    color: var(--ku-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.error-icon svg { width: 28px; height: 28px; }

.meta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ku-line);
    font-size: 12px;
    color: var(--ku-ink-muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.meta code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    background: var(--ku-blue-tint);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--ku-blue);
    font-size: 11px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--ku-blue-tint);
    border-top-color: var(--ku-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
    background: var(--ku-red-tint);
    color: #B4291A;
    border: 1px solid rgba(255, 73, 51, 0.25);
    border-left: 3px solid var(--ku-red);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}

.help-links {
    list-style: none;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--ku-line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.help-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--ku-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .15s ease;
}
.help-links a:hover { color: var(--ku-blue-dark); }
.help-links a::before {
    content: "›";
    color: var(--ku-gold);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}

.sp-info {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--ku-line);
    font-size: 13px;
    color: var(--ku-ink-muted);
    line-height: 1.5;
}
.sp-info img {
    max-height: 48px;
    width: auto;
    margin-bottom: 8px;
    display: block;
}

footer {
    position: relative;
    z-index: 1;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--ku-white);
    opacity: 0.9;
}

@media (max-width: 520px) {
    .wrapper { padding: 32px 16px 24px; }
    .card { padding: 28px 22px 24px; border-radius: 16px; }
    .brand-header img { height: 52px; }
    .brand-header .brand-text h1 { font-size: 17px; }
    .card-head h2 { font-size: 20px; }
}
