:root {
    --auth-black: #111111;
    --auth-muted: #777777;
    --auth-border: #e8e8e8;
    --auth-orange: #ff6b22;
}

* { box-sizing: border-box; }
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body.auth-page {
    margin: 0;
    color: var(--auth-black);
    background: #f7f7f7;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.about-page { margin: 0; min-height: 100%; overflow: auto; background: #f7f7f7; color: var(--auth-black); font-family: Arial, Helvetica, sans-serif; }
.about-shell { display: flex; flex-direction: column; align-items: center; gap: 32px; width: min(100% - 40px, 820px); min-height: 100vh; margin: 0 auto; padding: 52px 0; }
.about-card { padding: 38px 42px; border: 1px solid var(--auth-border); border-radius: 13px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }
.about-card h1 { margin: 0 0 24px; font-size: 34px; font-weight: 400; }
.about-card h2 { margin: 28px 0 9px; font-size: 20px; }
.about-card p { margin: 0; color: #555; line-height: 1.7; }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(520px, 1fr);
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}

.auth-visual { height: 100vh; overflow: hidden; background: #acd9f4; }
.auth-visual img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

.auth-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding: 68px 56px 60px;
    background: #fafafa;
}

.auth-logo { display: inline-flex; flex: 0 0 auto; }
.auth-logo img { display: block; width: 158px; height: auto; }

.auth-main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 58px 0 48px;
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-form-wrap { width: min(100%, 620px); }
.auth-form-wrap--login { max-width: 500px; }
.auth-form-wrap--register {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.auth-heading { margin-bottom: 20px; text-align: center; }

.auth-heading h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.07;
    letter-spacing: -1.4px;
}

.auth-card {
    width: 100%;
    padding: 40px 44px 36px;
    border: 1px solid var(--auth-border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.auth-card--register { padding: 30px 34px 26px; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.input-wrap { position: relative; }

.auth-input {
    width: 100%;
    min-height: 52px;
    padding: 14px 44px 14px 16px;
    color: var(--auth-black);
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    outline: 0;
    background: #fff;
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.auth-input::placeholder { color: #a3a3a3; }
.auth-input:focus { border-color: #b9b9b9; box-shadow: 0 0 0 3px rgba(17, 17, 17, .06); }

.input-icon, .password-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    display: grid;
    width: 21px;
    height: 21px;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    color: #2b2b2b;
    border: 0;
    background: transparent;
}

.password-toggle { cursor: pointer; }
.input-icon svg, .password-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.password-toggle.is-visible { color: var(--auth-orange); }

.remember-row {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin: 3px 0 1px;
    font-size: 14px;
    cursor: pointer;
}

.remember-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--auth-black); }

.auth-submit {
    width: 100%;
    min-height: 46px;
    padding: 12px 20px;
    color: #fff;
    border: 1px solid var(--auth-black);
    border-radius: 999px;
    background: var(--auth-black);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    font: inherit;
    cursor: pointer;
    transition: transform .2s, background-color .2s, border-color .2s;
}

.auth-submit:hover { border-color: var(--auth-orange); background: var(--auth-orange); transform: translateY(-1px); }
.auth-submit:focus-visible, .back-link:focus-visible, .auth-link-row a:focus-visible { outline: 3px solid rgba(255, 107, 34, .35); outline-offset: 3px; }

.auth-link-row { display: flex; justify-content: space-between; gap: 20px; margin-top: 3px; font-size: 14px; }
.auth-link-row a, .auth-switch a { color: #333; text-decoration: none; }
.auth-link-row a:hover, .auth-switch a:hover { color: var(--auth-orange); }

.back-link { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 5px; color: var(--auth-black); font-size: 15px; text-decoration: none; }
.back-link:hover { color: var(--auth-orange); }
.auth-footer { display: flex; align-items: center; flex: 0 0 auto; gap: 22px; }

.auth-message { margin-bottom: 16px; padding: 11px 13px; border-radius: 8px; font-size: 14px; line-height: 1.4; }
.auth-message.error { color: #842029; border: 1px solid #f5c2c7; background: #f8d7da; }
.auth-message.success { color: #0f5132; border: 1px solid #badbcc; background: #d1e7dd; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field-group { display: flex; flex-direction: column; gap: 7px; color: #333; font-size: 13px; }
.field-group--full { grid-column: 1 / -1; }
.field-group .auth-input { min-height: 45px; padding: 11px 13px; }
.field-group select.auth-input { cursor: pointer; }
.field-help { color: var(--auth-muted); font-size: 11px; line-height: 1.4; }
.auth-file-input {
    width: 100%;
    padding: 10px;
    color: #555;
    border: 1px dashed #cfcfcf;
    border-radius: 8px;
    background: #fafafa;
    font: inherit;
    cursor: pointer;
}
.auth-file-input::file-selector-button {
    margin-right: 12px;
    padding: 8px 13px;
    color: #fff;
    border: 0;
    border-radius: 999px;
    background: var(--auth-black);
    cursor: pointer;
}
.auth-textarea { min-height: 68px !important; resize: vertical; }
.auth-intro { margin: 0 0 3px; color: var(--auth-muted); font-size: 14px; line-height: 1.5; text-align: center; }
.auth-switch { margin: -2px 0 0; color: var(--auth-muted); text-align: center; font-size: 13px; }

.register-page .auth-content { padding-top: 38px; padding-bottom: 34px; }
.register-page .auth-main {
    justify-content: flex-start;
    padding-top: 22px;
    padding-bottom: 22px;
    overflow: hidden;
}
.register-page .auth-heading { margin-bottom: 13px; }
.register-page .auth-heading h1 { font-size: 29px; }
.register-page .auth-card--register {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c8c8c8 transparent;
}
.register-page .auth-card--register::-webkit-scrollbar { width: 6px; }
.register-page .auth-card--register::-webkit-scrollbar-thumb { border-radius: 10px; background: #c8c8c8; }

@media (max-width: 1050px) {
    .auth-shell { grid-template-columns: 43% 57%; }
    .auth-content { padding-right: 36px; padding-left: 36px; }
}

@media (max-width: 760px) {
    .auth-shell { display: block; height: 100vh; }
    .auth-visual { min-height: 240px; height: 34vh; }
    .auth-visual img { object-position: center 56%; }
    .auth-content { height: 66vh; min-height: 0; padding: 28px 20px 30px; }
    .auth-logo img { width: 135px; }
    .auth-main { padding: 34px 0; }
    .auth-card { padding: 28px 24px 25px; }
    .auth-heading h1 { font-size: 29px; }
    .register-page .auth-visual { display: none; }
    .register-page .auth-content { height: 100vh; min-height: 0; padding: 26px 16px; }
}

@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .field-group--full { grid-column: auto; }
    .auth-card--register { padding: 24px 20px; }
    .auth-link-row { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
