/* ==========================================================================
   Login
   ========================================================================== */

:root {
    --blue: #0082c6;
    --blue-hover: #006da8;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --card: #ffffff;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
}

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

html,
body {
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    background-color: #eef3f7;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(
            ellipse 55% 45% at 8% 12%,
            rgba(0, 130, 198, 0.1),
            transparent
        ),
        radial-gradient(
            ellipse 45% 40% at 92% 88%,
            rgba(0, 168, 255, 0.08),
            transparent
        );
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(
        rgba(0, 130, 198, 0.1) 1px,
        transparent 1px
    );
    background-size: 26px 26px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

.login-wrap {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    width: 220px;
    max-width: 80%;
    height: auto;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px 32px 32px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

.login-card h1 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.login-card .subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 28px;
}

.flash-message {
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger-text);
    margin-bottom: 20px;
}

.field {
    margin-bottom: 20px;
    position: relative;
}

.field.error input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field.error input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

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

.field-input {
    position: relative;
}

.field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.field input::placeholder {
    color: #9ca3af;
}

.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 130, 198, 0.1);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 42px;
}

.password-field button {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 40px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    border-radius: 6px;
}

.password-field button:hover {
    color: var(--blue);
}

.btn-submit {
    width: 100%;
    height: 44px;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-submit:hover:not(:disabled) {
    background: var(--blue-hover);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--muted);
}

.form-tooltip-error {
    position: static;
    right: auto;
    bottom: auto;
    margin: 6px 0 0;
    padding: 0;
    max-width: none;
    background: none;
    font-size: 0.75rem;
    color: var(--danger-text);
}

.form-tooltip-error::before {
    display: none;
}

.form-tooltip-error ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.form-tooltip-error li {
    line-height: 1.4;
    color: var(--danger-text);
}
