:root {
   color-scheme: light;
   --ink: #142238;
   --muted: #617086;
   --line: #dbe3ec;
   --surface: #ffffff;
   --surface-soft: #f4f7fb;
   --navy: #123c69;
   --navy-deep: #0a2848;
   --blue: #1b67a5;
   --aqua: #2ea6a2;
   --orange: #e87835;
   --danger: #b42318;
   --success: #19745a;
   --shadow: 0 24px 70px rgba(10, 40, 72, 0.14);
   --radius-lg: 28px;
   --radius-md: 16px;
   font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #eef3f8; }

body {
   min-height: 100vh;
   margin: 0;
   color: var(--ink);
   background:
      radial-gradient(circle at 8% 5%, rgba(46, 166, 162, 0.13), transparent 25rem),
      radial-gradient(circle at 94% 22%, rgba(232, 120, 53, 0.12), transparent 24rem),
      linear-gradient(180deg, #f8fafc 0%, #edf3f8 100%);
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header {
   width: min(1180px, calc(100% - 40px));
   margin: 0 auto;
   padding: 26px 0;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 24px;
}

.brand {
   display: inline-flex;
   align-items: center;
   gap: 13px;
   text-decoration: none;
}

.brand-mark {
   display: grid;
   place-items: center;
   min-width: 58px;
   height: 58px;
   padding: 0 9px;
   border-radius: 15px;
   color: #fff;
   background: linear-gradient(145deg, var(--navy), var(--blue));
   font-size: 11px;
   font-weight: 800;
   letter-spacing: .08em;
   box-shadow: 0 10px 25px rgba(18, 60, 105, .2);
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 18px; letter-spacing: -.01em; }
.brand-copy small { color: var(--muted); font-size: 13px; }

.header-link {
   padding: 10px 14px;
   border-radius: 12px;
   color: var(--navy);
   font-size: 14px;
   font-weight: 700;
   text-decoration: none;
}
.header-link:hover { background: rgba(18, 60, 105, .07); }

.page-shell {
   width: min(1180px, calc(100% - 40px));
   margin: 44px auto 70px;
   display: grid;
   grid-template-columns: minmax(0, 1.03fr) minmax(420px, .82fr);
   gap: clamp(42px, 7vw, 96px);
   align-items: start;
}

.intro { padding: 26px 0 0; }
.eyebrow {
   margin: 0 0 14px;
   color: var(--blue);
   font-size: 12px;
   font-weight: 850;
   letter-spacing: .15em;
}

.intro h1 {
   max-width: 650px;
   margin: 0;
   font-size: clamp(40px, 5vw, 68px);
   line-height: .99;
   letter-spacing: -.055em;
}

.lead {
   max-width: 600px;
   margin: 28px 0 0;
   color: var(--muted);
   font-size: 18px;
   line-height: 1.65;
}

.steps {
   margin: 38px 0 0;
   padding: 0;
   list-style: none;
   display: grid;
   gap: 14px;
}

.steps li { display: flex; align-items: center; gap: 14px; }
.steps li > span {
   display: grid;
   place-items: center;
   width: 36px;
   height: 36px;
   border: 1px solid rgba(18, 60, 105, .18);
   border-radius: 50%;
   color: var(--navy);
   background: rgba(255, 255, 255, .7);
   font-weight: 800;
}
.steps li div { display: grid; gap: 2px; }
.steps li b { font-size: 15px; }
.steps li small { color: var(--muted); font-size: 13px; }

.info-note {
   max-width: 600px;
   margin-top: 38px;
   padding: 18px 20px;
   display: grid;
   gap: 5px;
   border-left: 4px solid var(--aqua);
   border-radius: 0 14px 14px 0;
   background: rgba(255, 255, 255, .72);
   color: var(--muted);
   font-size: 14px;
   line-height: 1.5;
}
.info-note strong { color: var(--ink); }

.service-card {
   min-height: 470px;
   padding: clamp(24px, 4vw, 42px);
   border: 1px solid rgba(18, 60, 105, .08);
   border-radius: var(--radius-lg);
   background: rgba(255, 255, 255, .94);
   box-shadow: var(--shadow);
   backdrop-filter: blur(14px);
}

.loading-view {
   min-height: 390px;
   display: grid;
   place-content: center;
   justify-items: center;
   gap: 14px;
   color: var(--muted);
}
.spinner {
   width: 34px;
   height: 34px;
   border: 3px solid #dbe5ee;
   border-top-color: var(--blue);
   border-radius: 50%;
   animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-heading { margin-bottom: 28px; }
.card-heading.compact { margin-top: 28px; margin-bottom: 22px; }
.card-heading h2, .success-view h2 {
   margin: 7px 0 8px;
   font-size: 28px;
   line-height: 1.15;
   letter-spacing: -.035em;
}
.card-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.step-label {
   color: var(--orange);
   font-size: 12px;
   font-weight: 850;
   letter-spacing: .08em;
   text-transform: uppercase;
}

form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > span:first-child, .fieldset-reset legend {
   color: #34435a;
   font-size: 14px;
   font-weight: 720;
}
.field small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fieldset-reset { min-width: 0; margin: 0; padding: 0; border: 0; }
.fieldset-reset legend { margin-bottom: 8px; }

input, select, textarea {
   width: 100%;
   border: 1px solid #cbd7e4;
   border-radius: 12px;
   outline: none;
   color: var(--ink);
   background: #fff;
   transition: border-color .18s, box-shadow .18s, background .18s;
}
input, select { min-height: 48px; padding: 0 14px; }
textarea { min-height: 104px; padding: 13px 14px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
   border-color: var(--blue);
   box-shadow: 0 0 0 4px rgba(27, 103, 165, .12);
}
input:disabled, select:disabled, textarea:disabled { background: #edf2f6; cursor: not-allowed; }

.password-field { position: relative; display: block; }
.password-field input { padding-right: 92px; }
.text-button {
   position: absolute;
   top: 50%;
   right: 7px;
   transform: translateY(-50%);
   border: 0;
   padding: 8px;
   color: var(--blue);
   background: transparent;
   font-size: 12px;
   font-weight: 750;
}

.segmented-control {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 6px;
   padding: 5px;
   border-radius: 13px;
   background: #edf2f7;
}
.segmented-control label { position: relative; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span {
   min-height: 40px;
   display: grid;
   place-items: center;
   border-radius: 9px;
   color: var(--muted);
   font-size: 13px;
   font-weight: 700;
   transition: .18s;
}
.segmented-control input:checked + span {
   color: var(--navy);
   background: #fff;
   box-shadow: 0 3px 10px rgba(20, 34, 56, .09);
}
.segmented-control input:focus-visible + span { outline: 3px solid rgba(27, 103, 165, .25); }

.consent-row {
   display: grid;
   grid-template-columns: 20px 1fr;
   gap: 10px;
   align-items: start;
   color: var(--muted);
   font-size: 13px;
   line-height: 1.45;
}
.consent-row input { width: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--blue); }

.primary-button {
   min-height: 50px;
   border: 0;
   border-radius: 13px;
   padding: 0 20px;
   color: #fff;
   background: linear-gradient(135deg, var(--navy), var(--blue));
   box-shadow: 0 12px 24px rgba(18, 60, 105, .2);
   font-weight: 800;
   transition: transform .18s, box-shadow .18s, opacity .18s;
}
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(18, 60, 105, .26); }
.primary-button:disabled { cursor: wait; opacity: .62; }

.quiet-button {
   border: 0;
   border-radius: 10px;
   padding: 9px 11px;
   color: var(--muted);
   background: transparent;
   font-size: 13px;
   font-weight: 700;
}
.quiet-button:hover { color: var(--navy); background: #edf3f8; }

.form-message { margin: -4px 0 0; border-radius: 11px; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.form-message.error { color: var(--danger); background: #fff0ee; }
.form-message.success { color: var(--success); background: #e7f6f0; }

.student-bar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   gap: 16px;
   padding-bottom: 20px;
   border-bottom: 1px solid var(--line);
}
.student-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; }
.student-bar small { flex-basis: 100%; color: var(--muted); }
.student-bar strong { font-size: 15px; }
.class-chip {
   border-radius: 999px;
   padding: 4px 8px;
   color: var(--success);
   background: #e7f6f0;
   font-size: 11px;
   font-weight: 850;
}

.success-view { padding: 16px 0 4px; text-align: center; }
.success-mark {
   display: grid;
   place-items: center;
   width: 68px;
   height: 68px;
   margin: 0 auto 24px;
   border-radius: 50%;
   color: #fff;
   background: linear-gradient(145deg, #148061, #37aa86);
   box-shadow: 0 14px 30px rgba(25, 116, 90, .22);
   font-size: 32px;
   font-weight: 800;
}
.success-view > p:not(.eyebrow) { color: var(--muted); }
.pickup-card {
   margin: 26px 0;
   padding: 20px;
   display: grid;
   gap: 5px;
   border-radius: var(--radius-md);
   color: #fff;
   background: linear-gradient(145deg, var(--navy-deep), var(--navy));
   text-align: left;
}
.pickup-card small { color: rgba(255, 255, 255, .65); text-transform: uppercase; letter-spacing: .1em; }
.pickup-card strong { font-size: 22px; }
.pickup-card span { color: rgba(255, 255, 255, .78); font-size: 13px; }

.site-footer {
   width: min(1180px, calc(100% - 40px));
   margin: 0 auto;
   padding: 26px 0 34px;
   display: flex;
   justify-content: space-between;
   gap: 24px;
   border-top: 1px solid rgba(18, 60, 105, .12);
   color: var(--muted);
   font-size: 12px;
}
.site-footer a { color: var(--navy); font-weight: 700; text-decoration: none; }

/* Интерфейс оператора */
.operator-body { background: #edf2f7; }
.operator-shell { width: min(1280px, calc(100% - 36px)); margin: 26px auto 60px; }
.operator-header {
   margin-bottom: 22px;
   display: flex;
   justify-content: space-between;
   align-items: end;
   gap: 20px;
}
.operator-header h1 { margin: 5px 0 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.operator-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.secondary-button {
   min-height: 42px;
   border: 1px solid #cbd7e4;
   border-radius: 11px;
   padding: 0 14px;
   color: var(--navy);
   background: #fff;
   font-size: 13px;
   font-weight: 750;
}
.secondary-button:hover { border-color: #9eb4c8; background: #f7fafc; }
.operator-card { padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 16px 45px rgba(10, 40, 72, .1); }
.operator-login { width: min(430px, 100%); margin: 90px auto; }
.records-card { margin-top: 22px; }
.operator-section-heading {
   margin-bottom: 20px;
   display: flex;
   align-items: start;
   justify-content: space-between;
   gap: 20px;
}
.operator-section-heading h2 { margin: 4px 0 6px; font-size: 24px; letter-spacing: -.025em; }
.operator-section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.template-workspace { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(430px, 1.3fr); gap: 22px; align-items: start; }
.template-list { display: grid; gap: 9px; }
.template-list-item {
   width: 100%;
   border: 1px solid var(--line);
   border-radius: 13px;
   padding: 13px 14px;
   display: grid;
   grid-template-columns: minmax(0, 1fr) auto;
   gap: 4px 12px;
   color: var(--ink);
   background: #fff;
   text-align: left;
}
.template-list-item:hover, .template-list-item.is-selected { border-color: #9eb4c8; background: #f5f9fc; }
.template-list-item strong { overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.template-list-item small { grid-column: 1; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.template-status { grid-column: 2; grid-row: 1 / span 2; align-self: center; border-radius: 999px; padding: 4px 8px; color: var(--success); background: #e7f6f0; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.template-status.is-disabled { color: #7a4b14; background: #fff3df; }
.template-editor-empty { min-height: 220px; border: 1px dashed #bdcbd9; border-radius: 15px; padding: 32px; display: grid; place-content: center; color: var(--muted); background: var(--surface-soft); text-align: center; }
.template-editor-empty strong { color: var(--ink); font-size: 17px; }
.template-editor-empty p { max-width: 430px; margin: 8px 0 0; font-size: 13px; line-height: 1.6; }
.template-form { border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: var(--surface-soft); }
.template-fields-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.template-options { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.template-options label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.template-options input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--blue); }
.template-body { min-height: 250px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.template-form-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.template-form-actions .primary-button { min-height: 42px; }
.toolbar { margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.toolbar select { width: auto; min-width: 180px; }
.record-count { color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.records-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.records-table th, .records-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.records-table th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: #f6f8fb; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.records-table td { font-size: 13px; line-height: 1.4; }
.records-table tbody tr:hover { background: #f8fbfd; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.record-button { border: 0; padding: 0; color: var(--blue); background: transparent; font-weight: 850; }
.empty-state { padding: 54px 20px; color: var(--muted); text-align: center; }
.operator-message { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
   .page-shell { grid-template-columns: 1fr; margin-top: 10px; }
   .intro { padding-top: 0; }
   .intro h1 { max-width: 760px; }
   .lead { max-width: 760px; }
   .steps { grid-template-columns: repeat(3, 1fr); }
   .steps li { align-items: flex-start; }
   .info-note { max-width: none; }
   .template-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
   .site-header { width: min(100% - 28px, 1180px); padding: 18px 0; }
   .brand-copy small, .header-link { display: none; }
   .page-shell { width: min(100% - 24px, 1180px); gap: 30px; margin-bottom: 42px; }
   .intro h1 { font-size: 39px; }
   .lead { margin-top: 20px; font-size: 16px; }
   .steps { grid-template-columns: 1fr; gap: 11px; margin-top: 26px; }
   .info-note { margin-top: 24px; }
   .service-card { min-height: 0; border-radius: 22px; }
   .site-footer { width: min(100% - 28px, 1180px); flex-direction: column; gap: 8px; }
   .operator-shell { width: min(100% - 20px, 1280px); }
   .operator-header { align-items: flex-start; flex-direction: column; }
   .operator-card { padding: 16px; border-radius: 16px; }
   .operator-section-heading { flex-direction: column; }
   .template-fields-two { grid-template-columns: 1fr; }
   .template-form { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
   *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
