@import url('/styles/app-background.css');

:root {
    --primary-color: #15385f;
    --secondary-color: #2b5f95;
    --font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --auth-text: #112133;
    --auth-subtle: #4b6077;
    --auth-border: #cdd7e3;
    --auth-surface: rgba(255, 255, 255, 0.94);
    --auth-shadow: 0 24px 56px rgba(14, 36, 58, 0.22);
    --auth-radius: 14px;
    --focus-ring: 0 0 0 3px rgba(21, 56, 95, 0.24);
    --success-color: #1f8d44;
    --error-color: #c43838;
}

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

body {
    font-family: var(--font-family);
    margin: 0;
    min-height: 100vh;
    color: var(--auth-text);
}

.container {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 36px);
}

.form-container.auth-card {
    width: min(94vw, 460px);
    padding: clamp(24px, 3.2vw, 34px);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(8px);
}

.logo {
    width: 100%;
    max-height: min(24vh, 210px);
    object-fit: contain;
    margin-bottom: clamp(8px, 1.5vw, 14px);
}

.auth-title {
    margin: 0;
    text-align: center;
    color: var(--primary-color);
    font-size: clamp(1.5rem, 2.6vw, 1.95rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-subtitle {
    margin: 8px 0 0;
    text-align: center;
    color: var(--auth-subtle);
    font-size: clamp(0.92rem, 2vw, 1rem);
}

.auth-form {
    margin-top: 20px;
}

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

label {
    display: block;
    margin-bottom: 7px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.92rem;
}

input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    color: var(--auth-text);
    font-size: 0.97rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input::placeholder {
    color: #7b8ea4;
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
    background: #fff;
}

input.input-error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(196, 56, 56, 0.18);
}

button {
    width: 100%;
    margin-top: 4px;
    padding: 11px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.97rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.16s ease, opacity 0.16s ease;
}

button:hover {
    filter: brightness(1.06);
}

button:active {
    transform: translateY(1px);
}

button:focus-visible,
.text-link-button:focus-visible,
.auth-alt-link a:focus-visible,
.secondary-link-action:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 8px;
}

button[disabled],
button.is-loading {
    cursor: not-allowed;
    opacity: 0.76;
}

button.is-loading::after {
    content: " ...";
    font-weight: 400;
}

.form-message {
    min-height: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.35;
}

.form-message.is-success {
    color: var(--success-color);
}

.form-message.is-error {
    color: var(--error-color);
}

.form-message.is-warning {
    color: #8a6200;
}

.auth-secondary {
    margin-top: 14px;
    margin-bottom: 6px;
    text-align: center;
}

.text-link-button {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 0.91rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
}

.forgot-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: rgba(245, 248, 252, 0.92);
    text-align: left;
}

.forgot-panel button {
    margin-top: 0;
}

.auth-alt-link {
    margin: 16px 0 0;
    text-align: center;
    color: var(--auth-subtle);
    font-size: 0.92rem;
}

.auth-alt-link a,
.secondary-link-action {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-alt-link a:hover,
.secondary-link-action:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.auth-actions-row {
    margin-top: 10px;
    text-align: center;
}

@media (max-width: 520px) {
    .form-container.auth-card {
        padding: 20px 16px;
        width: min(96vw, 430px);
    }

    .auth-title {
        font-size: 1.45rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-height: 760px) {
    .container {
        align-items: flex-start;
        padding-top: 14px;
        padding-bottom: 14px;
    }
}
