﻿/* Figma: Login – Sonarfy, 84:328 / 84:370 / 84:411 / 84:453.
   Inset borders preserve the exact Auto Layout content dimensions. */
:root {
    color-scheme: light;
    --page-bg: #fff;
    --card-bg: #fff;
    --input-bg: #fff;
    --text-primary: #1a1a1a;
    --text-secondary: #65676b;
    --border-color: #ebecef;
    --input-border: #8c8d90;
    --accent-color: #27a9f5;
    --button-text: #1a1a1a;
    --button-border: #1a1a1a;
    --accent-hover: #51baf7;
    --accent-active: #1594df;
    --focus-ring: #1677b3;
    --error-color: #b42318;
    --error-bg: #fef3f2;
    --success-color: #216e39;
    --success-bg: #ecfdf3;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --radius-control: 8px;
    --radius-card: 16px;
    --card-shadow: none;
    font-family: Inter, sans-serif;
}
[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #1a1a1a;
    --card-bg: #242424;
    --input-bg: #1a1a1a;
    --text-primary: #fff;
    --text-secondary: #b2b3b5;
    --border-color: #65676b;
    --button-border: #27a9f5;
    --focus-ring: #77caff;
    --error-color: #fda29b;
    --error-bg: #401c1a;
    --success-color: #86efac;
    --success-bg: #183524;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
    color: var(--text-primary);
}
h1, p {
    margin: 0;
}
button, input {
    font: inherit;
}
button, a, input {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
a {
    color: var(--accent-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 4px;
}
/* Keep icon assets at their intrinsic dimensions. */
.ui-icon { display: block; flex-shrink: 0; }
.brand-desktop { display: block; }
.brand-mobile { display: none; }
[hidden], .theme-dark-only {
    display: none !important;
}
[data-theme="dark"] .theme-light-only {
    display: none;
}
[data-theme="dark"] .theme-dark-only {
    display: block !important;
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    padding: var(--space-2) 64px;
    box-shadow: inset 0 -1px var(--border-color);
}
.brand {
    display: inline-flex;
    gap: var(--space-1);
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
/* Register and Verify still use the shared text-and-circle brand. */
.brand-symbol {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #1a1a1a;
    font-size: 25px;
    font-weight: 600;
    font-style: italic;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text-secondary);
}
.icon-button:hover {
    background: var(--border-color);
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 48px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}
.mobile-home {
    display: none;
}
.auth-container {
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 662px;
    padding: var(--space-6);
}
.login-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    max-width: 480px;
    min-width: 0;
}
.login-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
    min-width: 0;
    padding: var(--space-4);
    background: var(--card-bg);
    border-radius: var(--radius-card);
    outline: 1px solid var(--border-color);
    outline-offset: -1px;
    box-shadow: var(--card-shadow);
}
.form-introduction {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    text-align: center;
}
h1 {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
}
.form-introduction p {
    font-size: 15px;
    line-height: 24px;
    color: var(--text-secondary);
}
.credentials {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}
.input-group label {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}
.login-field {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius-control);
    box-shadow: inset 0 0 0 1px var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 24px;
}
.login-field::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}
.login-field:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}
.password-input-wrapper {
    display: flex;
    align-items: center;
    border-radius: var(--radius-control);
    background: var(--input-bg);
    box-shadow: inset 0 0 0 1px var(--input-border);
}
.password-input-wrapper .login-field {
    flex: 1;
    width: 0;
    box-shadow: none;
    background: transparent;
}
.password-input-wrapper:focus-within {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}
.password-input-wrapper .login-field:focus {
    outline: none;
}
.btn-toggle-password {
    color: var(--input-border);
    border-radius: 0 var(--radius-control) var(--radius-control) 0;
}
#theme-toggle { color: var(--text-primary); }
.btn-toggle-password:hover { color: var(--text-primary); }
.btn-toggle-password .eye-off, .btn-toggle-password[aria-pressed="true"] .eye-open { display: none; }
.btn-toggle-password[aria-pressed="true"] .eye-off { display: block; }
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-1);
    font-size: 13px;
    line-height: 24px;
}
.login-options a, .auth-links a {
    font-weight: 600;
}
.checkbox-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-secondary);
    cursor: pointer;
}
.checkbox-container input {
    appearance: none;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1.5px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    cursor: pointer;
}
.checkbox-container input:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}
.checkbox-check { position: absolute; left: 2px; top: calc(50% - 8px); color: var(--button-text); pointer-events: none; visibility: hidden; }
.checkbox-container input:checked + .checkbox-check { visibility: visible; }
.btn-submit {
    width: 100%;
    min-height: 48px;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--button-border);
    border-radius: var(--radius-control);
    background: var(--accent-color);
    color: var(--button-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 18px;
}
.btn-submit:hover {
    background: var(--accent-hover);
}
.btn-submit:active {
    background: var(--accent-active);
}
.btn-submit:disabled {
    opacity: .65;
    cursor: wait;
}
.login-field:disabled, .btn-toggle-password:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.auth-footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.auth-links {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 24px;
}
.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-color);
    font-weight: 600;
    line-height: inherit;
    text-decoration: none;
}
.link-button:hover {
    text-decoration: underline;
}
.link-button:disabled {
    opacity: .65;
    cursor: wait;
}
.feedback {
    display: none;
    padding: 12px;
    border-radius: var(--radius-control);
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}
.feedback-error {
    color: var(--error-color);
    background: var(--error-bg);
}
.feedback-success {
    color: var(--success-color);
    background: var(--success-bg);
}
.feedback a {
    font-weight: 600;
    text-decoration: underline;
}
.field-error {
    color: var(--error-color);
    font-size: 12px;
    line-height: 20px;
}
.login-field[aria-invalid="true"] {
    box-shadow: inset 0 0 0 1.5px var(--error-color);
}
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 168px;
    padding: 32px 20px 40px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 20px;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.footer-links a {
    color: inherit;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .brand-desktop {
        display: none;
    }
    .brand-mobile {
        display: block;
    }
    .site-header {
        min-height: 80px;
        padding: var(--space-2) var(--space-3);
    }
    .brand {
        font-size: 16px;
    }
    .brand-symbol {
        width: 24px;
        height: 24px;
        font-size: 19px;
    }
    .mobile-home {
        display: inline-flex;
    }
    .desktop-home {
        display: none;
    }
    .auth-container {
        min-height: 656px;
        padding: var(--space-4) var(--space-3);
    }
    .login-card {
        padding: var(--space-3);
    }
    h1 {
        font-size: 28px;
    }
    .login-field {
        font-size: 14px;
    }
    .login-options {
        font-size: 12px;
    }
}
@media (max-width: 374px) {
    .login-options {
        flex-wrap: wrap;
    }
    h1 {
        font-size: 24px;
    }
}
@media (forced-colors: active) {
    .login-card, .login-field, .password-input-wrapper, .site-header {
        border: 1px solid CanvasText;
    }
    .checkbox-container input {
        appearance: auto;
    }
    .checkbox-check {
        display: none;
    }
}
