:root {
    --auth-accent: #005f83;
    --auth-accent-dark: #003f59;
    --auth-text: #171717;
    --auth-muted: #626262;
    --auth-border: #a5a5a1;
    --auth-white: #fff;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--auth-text);
    background: var(--auth-white);
    font-family: "Inter", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.brand .app-logo-image {
    display: block;
    width: auto;
    height: 48px;
}

.auth-close-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--auth-muted);
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    transition: color 0.18s ease, background 0.18s ease;
}

.auth-close-button:hover {
    color: var(--auth-text);
    background: #f1f1f1;
}

.auth-form > button:hover {
    background: var(--auth-accent-dark);
}

.auth-page {
    min-height: calc(100vh - 76px);
    display: flex;
    justify-content: center;
    padding: 44px 24px 72px;
}

.auth-panel {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: min(100%, 540px);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 6vw, 42px);
    line-height: 1.18;
    letter-spacing: -1.2px;
}

.auth-subtitle {
    margin: 0 0 28px;
    color: var(--auth-text);
    font-size: 18px;
    line-height: 1.45;
}

.form-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #f0b8b8;
    border-radius: 12px;
    color: #8a1f1f;
    background: #fff1f1;
    font-size: 14px;
    font-weight: 600;
}

.google-button {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 12px 54px;
    border: 1.5px solid var(--auth-border);
    border-radius: 20px;
    color: var(--auth-text);
    background: var(--auth-white);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.google-button:hover {
    border-color: #777;
    background: #fafafa;
}

.google-logo {
    position: absolute;
    left: 20px;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 22px 0;
    color: var(--auth-text);
    font-size: 15px;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    content: "";
    background: #e4e4e4;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.form-field {
    display: grid;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.form-field input {
    width: 100%;
    min-height: 64px;
    padding: 14px 20px;
    border: 1.5px solid var(--auth-border);
    border-radius: 18px;
    color: var(--auth-text);
    background: var(--auth-white);
    font: inherit;
    font-size: 18px;
}

.form-field input::placeholder {
    color: #696963;
    opacity: 1;
}

.form-field input:focus {
    border-color: var(--auth-accent);
    outline: 3px solid rgba(0, 95, 131, 0.16);
}

.password-field {
    position: relative;
}

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

.password-toggle {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--auth-text);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:focus-visible {
    outline: 3px solid rgba(0, 95, 131, 0.25);
    outline-offset: 2px;
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    display: block;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.password-toggle.is-hidden .password-toggle-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.58 10.58a2 2 0 1 0 2.83 2.83'/%3E%3Cpath d='M9.88 5.08A10.94 10.94 0 0 1 12 5c6.5 0 10 7 10 7a18.5 18.5 0 0 1-5.08 5.42'/%3E%3Cpath d='M6.61 6.61A18.1 18.1 0 0 0 2 12s3.5 7 10 7a11 11 0 0 0 5.08-1.3'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

.auth-form > button {
    min-height: 64px;
    margin-top: 8px;
    border: 0;
    border-radius: 18px;
    color: var(--auth-white);
    background: var(--auth-accent);
    font: inherit;
    font-size: 19px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.auth-form > button:active {
    transform: translateY(1px);
}

.auth-switch {
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 15px;
    text-align: center;
}

.auth-switch a {
    color: var(--auth-accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 480px) {
    .auth-header {
        min-height: 68px;
        padding: 10px 16px;
    }

    .brand .app-logo-image {
        height: 42px;
    }

    .auth-page {
        min-height: calc(100vh - 68px);
        padding: 40px 16px 56px;
    }

    .auth-card h1 {
        font-size: 32px;
    }

    .auth-subtitle {
        margin-bottom: 26px;
        font-size: 17px;
    }

    .google-button,
    .form-field input,
    .auth-form > button {
        min-height: 62px;
    }

    .google-button {
        border-radius: 17px;
        font-size: 17px;
    }

    .form-field input {
        border-radius: 17px;
        font-size: 17px;
    }

    .auth-form > button {
        border-radius: 17px;
    }
}
