/*
 * Login UI styles for service-auth.
 *
 * Split screen (see _LoginLayout.cshtml): photo panel on the left, the page
 * on the right. Covers only the three screens this host renders (login,
 * logout, error), so there is no framework behind it. Colours and the font
 * follow the portal design system (fiskaltrust/brand-design-system).
 */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");

:root {
    --ft-primary: #00a7ce;        /* --fiskaltrust */
    --ft-primary-hover: #007d9a;  /* --petrol-500 */
    --ft-text: #18181b;
    --ft-muted: #71717a;
    --ft-border: #e4e4e7;
    --ft-ring: #e5f6fa;           /* --petrol-100 */
    --ft-input-bg: #fafafa;
    --ft-danger: #dc2626;
    --ft-danger-bg: #fef2f2;
    --radius: 7px;
}

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

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

body {
    font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ft-text);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ft-primary);
    text-decoration: none;
}
a:hover, a:focus-visible {
    color: var(--ft-primary-hover);
    text-decoration: underline;
}

/* -- Shell ---------------------------------------------------------------- */

.auth-shell {
    display: grid;
    grid-template-columns: 44fr 56fr;
    min-height: 100vh;
}

.auth-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 43px 29px;
}

.auth-card {
    width: 100%;
    max-width: 423px;
}

/* -- Language toggle ----------------------------------------------------- */

/* Market language / English, pinned to the top right of the form side. */
.lang-toggle {
    position: absolute;
    top: 22px;
    right: 29px;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--ft-input-bg);
    border: 1px solid var(--ft-border);
    border-radius: 999px;
}
.lang-toggle a,
.lang-toggle span {
    min-width: 38px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--ft-muted);
    border-radius: 999px;
    transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.lang-toggle a:hover {
    color: var(--ft-text);
    background: #ffffff;
    text-decoration: none;
}
.lang-toggle a:focus-visible {
    outline: 0;
    text-decoration: none;
    box-shadow: 0 0 0 0.2rem var(--ft-ring);
}
.lang-toggle [aria-current] {
    color: #ffffff;
    background: var(--ft-primary);
}
@media (max-width: 767px) {
    .lang-toggle { top: 16px; right: 16px; }
}

/* -- Brand panel ---------------------------------------------------------- */

.auth-brand {
    display: flex;
    align-items: center;
    /* The block is centred in the panel; its text stays left-aligned. */
    justify-content: center;
    /* Scales with the viewport so the split layout holds down to 768px. */
    padding: 58px clamp(29px, 3.6vw, 50px);
    color: #ffffff;
    /* The gradient keeps white text readable over the bright meadow. */
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0.1) 100%),
        url("../images/login-forest.jpg") center / cover no-repeat #1f3a1f;
}

.auth-brand-content {
    width: 100%;
    max-width: 360px;
}

.auth-brand-logo {
    display: block;
    width: clamp(153px, 14.8vw, 216px);
    max-width: 100%;
    height: auto;
    margin-bottom: 65px;
}

.auth-brand-title {
    margin: 0;
    font-size: clamp(27px, 2.6vw, 38px);
    font-weight: 700;
    line-height: 1.17;
    letter-spacing: -0.01em;
}

.auth-brand-text {
    max-width: 306px;
    margin: 22px 0 0;
    font-size: 14px;
    line-height: 1.8;
}

.auth-brand-list {
    list-style: none;
    margin: 50px 0 0;
    padding: 0;
    font-size: 14px;
}
.auth-brand-list li {
    display: flex;
    align-items: center;
    gap: 13px;
}
.auth-brand-list li + li {
    margin-top: 13px;
}
.auth-brand-list li::before {
    content: "";
    flex: none;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a7ce' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* Three equal columns across the divider, each figure centred over its
   label (dt sits under dd). Items are anchored to the top so the figures
   stay on one line when a label wraps to two. */
.auth-brand-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: clamp(14px, 2vw, 29px);
    margin: 50px 0 0;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}
.auth-brand-stats div {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}
.auth-brand-stats dd {
    margin: 0;
    font-size: clamp(18px, 1.8vw, 25px);
    font-weight: 700;
    line-height: 1.2;
}
.auth-brand-stats dt {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.85;
}

/* Short laptop screens: tighten the panel so it fits without scrolling. */
@media (max-height: 820px) {
    .auth-brand { padding-top: 36px; padding-bottom: 36px; }
    .auth-brand-logo { width: clamp(144px, 12.6vw, 180px); margin-bottom: 36px; }
    .auth-brand-title { font-size: clamp(25px, 2.2vw, 31px); }
    .auth-brand-text { margin-top: 14px; }
    .auth-brand-list,
    .auth-brand-stats { margin-top: 29px; }
    .auth-brand-stats { padding-top: 18px; }
    .auth-brand-stats dd { font-size: clamp(18px, 1.5vw, 22px); }
}
@media (max-height: 640px) {
    .auth-brand-stats { display: none; }
}

@media (max-width: 767px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-brand {
        display: none;
    }
}

/* -- Card content --------------------------------------------------------- */

.auth-logo {
    display: none;
    width: auto;
    max-width: 162px;
    max-height: 65px;
    margin: 0 0 36px;
}
@media (max-width: 767px) {
    .auth-logo { display: block; }
}

.auth-title {
    margin: 0;
    font-size: 31px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    margin: 11px 0 40px;
    font-size: 14px;
    color: var(--ft-muted);
}

/* -- Form ----------------------------------------------------------------- */

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

/* Label and link share the first row; the link follows the input in the
   markup to keep the Tab order e-mail → password. */
.label-row {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 11px;
    align-items: baseline;
}
.label-row > * {
    grid-column: 1 / -1;
}
.label-row > label {
    grid-column: 1;
}
.label-row > .label-link {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.form-control {
    display: block;
    width: 100%;
    height: 50px;
    padding: 4px 14px;
    font: inherit;
    font-size: 14px;
    color: var(--ft-text);
    background: var(--ft-input-bg);
    border: 1px solid var(--ft-border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.form-control::placeholder {
    color: #a1a1aa;
    opacity: 1;
}
.form-control:focus {
    outline: 0;
    background: #ffffff;
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 0.25rem var(--ft-ring);
}
.form-control.input-validation-error {
    border-color: var(--ft-danger);
}

.text-danger {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--ft-danger);
}
.text-danger:empty {
    display: none;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 9px 11px;
    font-size: 12px;
    color: var(--ft-danger);
    background: var(--ft-danger-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
}
.auth-alert ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* -- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 7px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover, .btn:focus-visible {
    text-decoration: none;
}
.btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem var(--ft-ring);
}
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.65;
}
.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    color: #ffffff;
    background: var(--ft-primary);
}
.btn-primary:hover, .btn-primary:focus-visible {
    color: #ffffff;
    background: var(--ft-primary-hover);
}

/* Portal design system: Button kind="secondary" color="info". */
.btn-secondary {
    color: var(--ft-primary);
    background: #ffffff;
    border: 1.5px solid var(--ft-primary);
}
.btn-secondary:hover {
    color: var(--ft-primary-hover);
    background: #ffffff;
    border-color: var(--ft-primary-hover);
}
.btn-secondary:focus-visible {
    color: var(--ft-primary);
    border-color: #ffffff;
    box-shadow: 0 0 0 0.25rem var(--ft-ring);
}
@media (forced-colors: active) {
    .btn-secondary:focus-visible {
        outline: 0.25rem solid;
    }
}

.divider {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 22px 0;
    font-size: 11px;
    text-transform: uppercase;
    color: #a1a1aa;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ft-border);
}

/* -- Motion --------------------------------------------------------------- */

@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 11px, 0); }
    to   { opacity: 1; transform: none; }
}
.animated.fadeInUp {
    animation: fadeInUp 0.35s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
    .animated.fadeInUp { animation: none; }
}
