/* Регистрация родителя: шаг email → имя и пароль (или вход), согласия; вопрос о коде класса при добавлении ребёнка.
   Одна карточка по центру (около 440 px): «Назад» и номер шага, заголовок, пояснение, форма.
   Подключается из parent_portal/registrations/new через content_for :head. */
.parent-flow{max-width:none;padding-top:40px}
.parent-flow .parent-flow-card{max-width:440px;padding:28px 32px 32px;border-radius:20px}
.parent-flow-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:-8px 0 12px}
.parent-flow-back{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin-left:-6px;padding:0 6px;border-radius:10px;font-size:14px;font-weight:600;color:#5f566f}
.parent-flow-back:hover{background:#f4f1f9;color:#30213e}
.parent-flow-step{margin-left:auto;font-size:13px;font-weight:600;color:#857c92}
.parent-flow-title{margin:0;font-size:28px;font-weight:700;line-height:1.2;letter-spacing:-.02em;color:#30213e}
.parent-flow-lead{margin:8px 0 0;font-size:15px;line-height:1.5;color:#6b6379}
.parent-flow-status{margin:10px 0 0;padding:10px 12px;border-radius:10px;background:#edf7f1;font-size:14px;font-weight:600;color:#2f6b4a}
.parent-flow .registration-card form{margin-top:22px}

/* Поля: на телефоне не меньше 16 px — iOS не увеличивает страницу при фокусе. */
.parent-flow .registration-card :is(input:not([type=checkbox]):not([type=radio]):not(.visually-hidden),select){min-height:50px;font-size:16px}
.parent-flow .field{margin-bottom:18px}
.parent-flow .field-hint{font-size:13px;font-weight:400;line-height:1.45;color:#766d84}
.parent-flow .field-error{display:block;margin-top:2px;font-size:14px;font-weight:500;line-height:1.45;color:#b02d44}
.parent-flow [aria-invalid=true]:not([type=checkbox]){border-color:#d9667a;background:#fff8f9}
.parent-flow .password-field>button{right:4px;width:44px;height:44px;border-radius:10px}
.parent-flow .password-field>button:hover{background:#f1eef7}
.parent-flow .btn.full{min-height:52px;font-size:16px}
.parent-flow .btn[disabled]{opacity:.7;cursor:progress}

/* Email плашкой с «Изменить». */
.parent-access-email>div{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:50px;padding:4px 4px 4px 14px;border:1px solid #ebe7f2;border-radius:12px;background:#f7f5fb}
.parent-access-email strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:600;color:#30213e}
.parent-access-email a{flex:none;display:inline-flex;align-items:center;min-height:42px;padding:0 10px;border-radius:9px;font-size:14px;font-weight:600;color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}
.parent-access-email a:hover{background:#ece7f5}
.parent-access-email+.parent-flow-error{margin:-10px 0 16px}
.parent-access-lead{margin:2px 0 14px;font-size:15px;font-weight:600;line-height:1.5;color:#30213e}
.parent-flow-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.parent-access-forgot{font-size:14px;font-weight:600;color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}

/* Согласия — отдельный блок, вся строка нажимается. */
.consent-fields{display:grid;gap:2px;margin:6px 0 20px;padding:6px;border:1px solid #ece8f3;border-radius:14px;background:#faf9fc}
.consent-fields-invalid{margin-bottom:6px}
.consent-field:has([aria-invalid=true]){background:#fff1f3;box-shadow:inset 0 0 0 1px #e7a3af}
.parent-flow-consent-error{margin:0 0 18px}
.consent-field{display:flex;align-items:flex-start;gap:12px;min-height:44px;padding:10px;border-radius:10px;font-size:14px;line-height:1.5;color:#585068;cursor:pointer}
.consent-field:hover{background:#f3f0f8}
.consent-field input{appearance:auto;flex:0 0 20px;width:20px;height:20px;margin:1px 0 0;accent-color:var(--action-purple);cursor:pointer}
.consent-field a{color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}

/* Ссылка для регистрации (/?class=…, /?school=…): плашка со школой и классом вместо вопроса о коде. */
.parent-flow-invite{margin:10px 0 0;padding:10px 12px;border-radius:10px;background:#f5f0fd;font-size:14px;font-weight:600;line-height:1.45;color:#4b3a66}
.parent-flow-note{margin:12px 0 0;padding:10px 12px;border-radius:10px;background:#fff6dc;font-size:14px;line-height:1.45;color:#6b5418}
.invite-plaque{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 20px;padding:14px 8px 14px 16px;border:1.5px solid #6544b7;border-radius:14px;background:#f5f0fd}
.invite-plaque dl{display:grid;gap:8px;margin:0;min-width:0}
.invite-plaque dt{font-size:12px;font-weight:600;line-height:1.3;color:#6b6379}
.invite-plaque dd{margin:2px 0 0;font-size:15px;font-weight:700;line-height:1.35;color:#30213e;overflow-wrap:anywhere}
.invite-plaque dd span{display:block;font-size:13px;font-weight:400;color:#6b6379}
.invite-plaque-change{flex:none;display:inline-flex;align-items:center;min-height:44px;padding:0 10px;border-radius:9px;font-size:14px;font-weight:600;color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}
.invite-plaque-change:hover{background:#ece7f5}

/* «Есть ли у вас код класса?» — два крупных варианта, выбранный подсвечен; остальные поля появляются плавно. */
.registration-question{margin:0 0 22px}
.registration-question legend{padding:0;margin:0 0 12px;font-size:18px;font-weight:700;line-height:1.35;color:#30213e}
.registration-question .registration-mode{display:grid;grid-template-columns:1fr;gap:10px;margin:0}
.registration-question .registration-mode-option{display:flex;align-items:flex-start;gap:10px;min-height:64px;padding:14px 16px;border:1.5px solid #e2dcec;border-radius:14px;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}
.registration-question .registration-mode-option:hover{border-color:#c9bce0}
.registration-question .registration-mode-option::before{content:"";flex:0 0 20px;height:20px;margin-top:1px;border:2px solid #c3b8d6;border-radius:50%;background:#fff;box-sizing:border-box}
.registration-question .registration-mode-option:has(:checked){border-color:var(--action-purple,#6544b7);background:#f5f0fd;box-shadow:0 0 0 3px #6544b71a;color:inherit}
.registration-question .registration-mode-option:has(:checked)::before{border:6px solid var(--action-purple,#6544b7)}
.registration-mode-text{display:grid;gap:3px}
.registration-mode-text strong{font-size:15px;font-weight:700;line-height:1.3;color:#30213e}
.registration-mode-text small{font-size:13px;line-height:1.4;color:#6b6379}
.parent-flow [data-child-registration-target]:not([hidden]):not(input){animation:parent-flow-reveal .22s ease-out}
@keyframes parent-flow-reveal{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.parent-flow [data-child-registration-target]{animation:none!important}.registration-question .registration-mode-option{transition:none}}
.registration-card [data-child-registration-target="invitation"]{margin-bottom:20px}
.child-registration-skip{margin:16px 0 0;text-align:center;font-size:14px}
.child-registration-skip a{display:inline-flex;align-items:center;min-height:44px;color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}

@media(max-width:520px){
  .parent-flow{padding-top:16px}
  .parent-flow .parent-flow-card{padding:20px 18px 24px;border-radius:18px}
  .parent-flow-title{font-size:25px}
}

/* Восстановление пароля: ответ после «Отправить». */
.password-sent .parent-flow-lead+.parent-flow-lead{margin-top:10px}
.password-sent .btn.full{margin-top:22px}

/* Ссылка класса: сначала поиск ребёнка по фамилии (только совпадения, не весь класс), потом — «Добавить ребёнка». */
.parent-flow .parent-flow-card>.invite-plaque{margin-top:22px}
.child-search{margin-top:4px}
.parent-flow .registration-card .child-search-title{margin:0;font-size:19px;font-weight:700;line-height:1.3;letter-spacing:-.01em;color:#30213e}
.parent-flow .registration-card .child-search-lead{margin:6px 0 0;font-size:14px;line-height:1.5;color:#6b6379}
.parent-flow .registration-card .child-search-form{margin-top:14px}
.parent-flow .child-search-form .field{margin-bottom:0}
.parent-flow .registration-card .child-search-row{display:flex;gap:8px;margin-top:6px}
.parent-flow .registration-card .child-search-row input{flex:1 1 auto;width:auto;min-width:0}
.parent-flow .registration-card .child-search-row .btn{flex:none;width:auto;min-height:50px;margin:0;padding:0 22px;font-size:16px}
.child-search-result{margin-top:16px}
.child-search-found{margin:0 0 8px;font-size:14px;font-weight:600;color:#5f566f}
.child-search-list{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.child-search-item{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;padding:8px 8px 8px 16px;border:1.5px solid #e4def0;border-radius:14px;background:#fff}
.child-search-name{min-width:0;font-size:16px;font-weight:700;line-height:1.35;color:#30213e;overflow-wrap:anywhere}
.parent-flow .registration-card form.child-search-claim{flex:none;margin:0}
.parent-flow .registration-card .child-search-claim .btn{width:auto;min-height:44px;margin:0;padding:0 14px;font-size:15px;white-space:nowrap}
.child-search-note{flex:none;max-width:48%;font-size:13px;font-weight:600;line-height:1.35;text-align:right;color:#766d84}
a.child-search-note{color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}
.child-search-missing{margin:14px 0 0;text-align:center}
.child-search-add-link{display:inline-flex;align-items:center;min-height:44px;padding:0 10px;border-radius:9px;font-size:15px;font-weight:600;color:var(--action-ink);text-decoration:underline;text-underline-offset:3px}
.child-search-add-link:hover{background:#ece7f5}
.child-search-empty{margin:0;padding:12px 14px;border-radius:12px;background:#fff6dc;font-size:14px;line-height:1.5;color:#6b5418}
.parent-flow .registration-card form.child-search-add{margin-top:20px;padding-top:20px;border-top:1px solid #ebe7f2}
@media (max-width:420px){
  .child-search-item{flex-wrap:wrap;padding:12px 12px 12px 14px}
  .parent-flow .registration-card .child-search-claim,.parent-flow .registration-card .child-search-claim .btn{width:100%}
  .child-search-note{max-width:none;text-align:left}
}

/* Телефон: кнопка кода страны слева, номер справа — одно поле; под ним список стран с поиском (phone-input). */
.phone-field{position:relative}
.phone-field>label{display:block}
.phone-input{display:flex;align-items:stretch;min-height:50px;margin-top:6px;border:1px solid #e0dbea;border-radius:12px;background:#fff;transition:border-color .15s,box-shadow .15s}
.phone-input:focus-within{border-color:#8a6fd1;box-shadow:0 0 0 3px #6544b724}
.phone-input-invalid{border-color:#d9667a;background:#fff8f9}
.parent-flow .registration-card .phone-input input[type=tel]{flex:1;min-width:0;min-height:48px;margin:0;padding:0 14px;border:0;border-radius:0 12px 12px 0;background:transparent;box-shadow:none;outline:0;font-size:16px;letter-spacing:.01em}
.parent-flow .registration-card .phone-input select.phone-country-select{flex:0 0 auto;width:132px;min-height:48px;margin:0;border:0;border-right:1px solid #ebe7f2;border-radius:12px 0 0 12px;background:#f7f5fb}
.phone-country-button{flex:none;display:inline-flex;align-items:center;gap:7px;min-height:48px;padding:0 10px 0 14px;border:0;border-right:1px solid #ebe7f2;border-radius:12px 0 0 12px;background:#f7f5fb;font-size:16px;font-weight:600;color:#30213e;cursor:pointer}
.phone-country-button::after{content:"";width:7px;height:7px;margin:-4px 2px 0 2px;border:solid #857c92;border-width:0 2px 2px 0;transform:rotate(45deg)}
.phone-country-button[aria-expanded=true]::after{margin-top:3px;transform:rotate(-135deg)}
.phone-country-button:hover{background:#efebf6}
.phone-country-button:focus-visible{outline:3px solid #6544b755;outline-offset:-3px}
.phone-country-flag{font-size:20px;line-height:1;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.phone-country-popover{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:40;padding:8px;border:1px solid #e4dfee;border-radius:14px;background:#fff;box-shadow:0 14px 36px #25233d26}
.parent-flow .registration-card .phone-country-popover input.phone-country-search{width:100%;min-height:44px;margin:0 0 6px;padding:0 12px;border:1px solid #e0dbea;border-radius:10px;background:#faf9fc;font-size:16px}
.phone-country-list{max-height:290px;margin:0;padding:0;overflow:auto;overscroll-behavior:contain;list-style:none;outline:0}
.phone-country-group{padding:10px 10px 4px;font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:#857c92}
.phone-country-option{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 10px;border-radius:9px;font-size:15px;color:#30213e;cursor:pointer}
.phone-country-option:hover,.phone-country-option.is-active{background:#f2edfb}
.phone-country-option[aria-selected=true]{font-weight:700}
.phone-country-option[aria-selected=true] .phone-country-dial{color:var(--action-ink,#5b3fb0)}
.phone-country-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-country-dial{flex:none;font-variant-numeric:tabular-nums;color:#766d84}
.phone-country-empty{margin:6px 10px 10px;font-size:14px;color:#766d84}
@media(max-width:520px){.phone-country-list{max-height:min(290px,45dvh)}}
