/* style.css */
@import './reset.css';

/* Подключение шрифта Inter */
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-MediumItalic.woff2') format('woff2');
    font-weight: 500;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-SemiBoldItalic.woff2') format('woff2');
    font-weight: 600;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-ExtraBoldItalic.woff2') format('woff2');
    font-weight: 800;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-BlackItalic.woff2') format('woff2');
    font-weight: 900;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-LightBETA.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-LightItalicBETA.woff2') format('woff2');
    font-weight: 300;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-ExtraLightBETA.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-ExtraLightItalicBETA.woff2') format('woff2');
    font-weight: 200;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-ThinBETA.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-ThinItalicBETA.woff2') format('woff2');
    font-weight: 100;
    font-style: italic;
}

/* ── Page layout ── */
.role-choice-page {
    font-family: 'Inter', sans-serif;
    display: flex;
    max-width: 1920px;
    margin: 0 auto;
    height: 100vh;
    padding: 24px 0;
    box-sizing: border-box;
}

/* ── Left green panel ── */
.panel-left {
    width: 50%;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 64px;
    background: url(/static/images/reg-bg.png) no-repeat center/cover, #056B23;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FFFFFF14;
    color: #fff;
    border-radius: 128px;
    padding: 8px 12px;
    width: fit-content;
    transition: background 0.2s;
    font-weight: 500;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -.02em;
}
.back-btn:hover {
    background: #FFFFFF1F;
}

.back-btn svg {

}

.panel-left-footer {
    margin-top: auto;
}

.panel-left-footer h2 {
    color: #fff;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 40px;
    line-height: 120%;
    letter-spacing: -.02em;
}

.panel-left-footer p {
    font-size: 24px;
    color: #FFFFFFB8;
    line-height: 34px;
    max-width: 641px;
    letter-spacing: -.02em;
}

/* ── Right panel ── */
.panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 146px;
}

.role-form-inner {
width: 100%;
max-width: 420px;
}

.role-form-inner h1 {
    font-weight: 500;
    font-size: 28px;
    line-height: 120%;
    letter-spacing: -.02em;
    margin-bottom: 12px;
    color: #20221E;
}

.role-form-inner p {
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -.02em;
    margin-bottom: 32px;
    color: #20221EB8;
}

.role-form-inner a {
    color: #81AD4F;
    margin-left: 12px;
}

/* ── Role grid ── */
.role-grid {
    display: grid;
    grid-template-columns: 220px 220px;
    gap: 24px;
    margin-bottom: 64px;
}

.role-card {
    display: flex;
    align-items: center;
    height: 96px;
    gap: 8px;
    background: #81AD4F1F;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    text-decoration: none;
    color: #20221EB8;
    font-size: 18px;
    line-height: 120%;
    letter-spacing: -.02em;
    font-weight: 500;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    user-select: none;
    position: relative;
}

.role-card:after {
    position: absolute;
    content: '';
    display: block;
    background-image: url(/static/images/checked.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-color: white;
    overflow: hidden;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    top: -8px;
    right: -8px;
    opacity: 0;
    transition: opacity 0.18s;
}

.role-card:hover {
    background: #81AD4F29;
}

.role-card.selected {
    border-color: #81AD4F;
    background: #81AD4F1F;
    color: #81AD4F;
}

.role-card.selected:after {
    opacity: 1;
}

.role-card .role-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5A5D57;
}

.role-card:hover .role-icon {
    color: #5A5D57;
}

.role-card.selected .role-icon {
    color: #81AD4F;
}

.role-card .role-icon svg {
}

/* Single-card row (Врач) */
.role-grid .role-card.solo {
    grid-column: span 1;
}

/* ── Continue button ── */
.btn-continue {
    display: inline-flex;
    align-items: center;
    background: #81AD4F;
    color: #fff;
    border: none;
    border-radius: 128px;
    padding: 14px 24px;
    letter-spacing: -.02em;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    text-decoration: none;
}

.btn-continue:disabled,
.btn-continue[aria-disabled="true"] {
    opacity: 0.56;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-continue:not(:disabled):hover {
background: #76A14D;
}
.btn-continue svg {
    width: 18px; height: 18px;
}

/* ── Responsive ── */
@media (max-width: 860px) {
.role-choice-page { flex-direction: column; }
.panel-left { width: 100%; min-height: 240px; border-radius: 0 0 32px 32px; }
.panel-right { padding: 40px 24px; }
.role-form-inner { max-width: 100%; }
}

/* ── Register page layout (mirrors .role-choice-page) ── */
.register-page {
    font-family: 'Inter', sans-serif;
    display: flex;
    max-width: 1920px;
    margin: 0 auto;
    height: 100vh;
    padding: 24px 0;
    box-sizing: border-box;
}

/* ── Left panel — reuse existing panel-left styles ── */
.register-page .panel-left {
    width: 50%;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 64px;
    background: url(/static/images/reg-bg.png) no-repeat center/cover, #056B23;
    flex-shrink: 0;
}

/* ── Right panel ── */
.register-page .panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    overflow-y: auto;
}

.register-form-inner {
    width: 100%;
    max-width: 468px;
}

.register-form-inner h1 {
    font-weight: 500;
    font-size: 28px;
    line-height: 120%;
    letter-spacing: -.02em;
    margin-bottom: 12px;
    color: #20221E;
}

.register-form-inner .subtitle {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -.02em;
    color: #20221EB8;
    margin-bottom: 32px;
}

.register-form-inner .subtitle a {
    color: #81AD4F;
    text-decoration: none;
    margin-left: 4px;
}

/* ── Error block ── */
.form-errors {
    background: #FFF0F0;
    border: 1px solid #F5C2C2;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #C0392B;
    line-height: 1.5;
}
.form-errors p { margin: 2px 0; }

/* ── Form fields ── */
.reg-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="password"] {
    width: 100%;
    max-width: 464px;
    height: 44px;
    background: #20221E0A;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    letter-spacing: -.02em;
    color: #20221E;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.18s, background 0.18s;
}

.form-field input::placeholder {
    color: #20221E73;
}

.form-field input:focus {
    background: #20221E0F;
}

/* Password wrapper with eye toggle */
.field-password {
    position: relative;
}

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

.toggle-pwd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #20221E73;
    transition: color 0.15s;
}
.toggle-pwd:hover { color: #20221E; }

/* ── Toggle (checkbox styled as iOS switch) ── */
.field-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    background: #20221E0A;
    border-radius: 12px;
    padding: 0 12px;
    gap: 12px;
}

.field-toggle-label {
    font-size: 16px;
    letter-spacing: -.02em;
    color: #20221EB8;
    flex: 1;
}

.field-toggle-label a {
    color: #81AD4F;
    text-decoration: none;
}

.switch {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: #20221E29;
    border-radius: 128px;
    transition: background 0.2s;
    cursor: pointer;
}

.switch-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    transition: transform 0.2s;
}

.switch input:checked + .switch-track {
    background: #81AD4F;
}

.switch input:checked + .switch-track::after {
    transform: translateX(18px);
}

/* ── Checkboxes ── */
.field-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 2px 0;
}

.field-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #81AD4F1A;
    border: 1px solid #81AD4F40;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 16px;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.field-checkbox input[type="checkbox"]:checked {
    background: #81AD4F;
    border-color: #81AD4F;
}

.field-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 2px;
    width: 6px; height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(40deg);
}

.field-checkbox label {
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -.02em;
    color: #20221E7A;
    cursor: pointer;
    margin-top: 16px;
}

.field-checkbox label a {
    color: #81AD4F;
    text-decoration: none;
}

/* ── Submit button ── */
.btn-register {
    width: 100%;
    height: 52px;
    background: #81AD4F;
    color: #fff;
    border: none;
    border-radius: 128px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    margin-top: 12px;
}

.btn-register:hover { background: #76A14D; }

.btn-register:disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

/* Loading spinner inside button */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.btn-register .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.btn-register.loading .spinner { display: block; }
.btn-register.loading .btn-text { opacity: 0.7; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .register-page { flex-direction: column; height: auto; padding: 0; }
    .register-page .panel-left { width: 100%; min-height: 220px; border-radius: 0 0 32px 32px; }
    .register-page .panel-right { padding: 40px 24px; }
    .register-form-inner { max-width: 100%; }
}