/* The parent app on the Ionic iOS 27 theme: burgundy accent, soft backdrop for the glass bars. */
:root {
  --ion-color-primary: #5b1f3a;
  --ion-color-primary-rgb: 91, 31, 58;
  --ion-color-primary-contrast: #fff;
  --ion-color-primary-shade: #501b33;
  --ion-color-primary-tint: #6b354e;
  --ink: #1c1c1e;
  --soft: #5c5c66;
  --line: #e2e2e8;
  --ok: #1d6b4f;
  --warn: #8a4b00;
  color-scheme: light;
}
ion-content { --background: linear-gradient(165deg, #f3dbe4 0%, #f2f2f7 24rem, #e5ecf6 100%); --color: var(--ink); }
[hidden] { display: none !important; }
main { max-width: 34rem; margin: 0 auto; padding: 0 1.25rem 1rem; }
main:focus { outline: none; }
h1 { margin: 1rem 0 .75rem; font-size: 1.85rem; font-weight: 700; line-height: 1.15; text-wrap: balance; }
h2 { margin: 1.5rem 0 .5rem; font-size: 1.25rem; }
h3 { margin: 1.25rem 0 .4rem; font-size: 1.05rem; }
p { margin: 0 0 .9rem; line-height: 1.45; }
a { color: var(--ion-color-primary); }
#saved { margin: 1rem 1.25rem 2rem; color: var(--soft); font-size: .85rem; text-align: center; }
#saved.failed { color: #a4161a; font-weight: 700; }
.hint { color: var(--soft); font-size: .92rem; }
.error { min-height: 1.4em; margin: .5rem 0; color: #a4161a; }
.notice, .success { padding: .8rem 1rem; border-radius: 1.1rem; background: #fdf0dc; color: var(--warn); }
.success { background: #e3f3ea; color: var(--ok); font-weight: 600; }
.notes { padding-left: 1.2rem; }
.notes li { margin-bottom: .35rem; line-height: 1.4; }
ion-button { margin: .6rem 0 0; text-transform: none; }
ion-button[expand="block"] { min-height: 3.1rem; }
ion-list[inset="true"] { margin: .75rem -1.25rem; }
ion-progress-bar { border-radius: 2px; }
main > ion-progress-bar { margin: .25rem 0; }
.state-icon { width: 1.5rem; height: 1.5rem; margin-inline-end: .75rem; }
.state-icon.ok { filter: invert(37%) sepia(39%) saturate(900%) hue-rotate(109deg); }
.state-icon.warn { filter: invert(33%) sepia(95%) saturate(900%) hue-rotate(15deg); }
.state-icon.idle, .state-icon.info { opacity: .4; }

/* Fields and choices as iOS grouped cards. */
input[type="text"], input[type="date"], input[type="tel"], input[type="password"], select {
  width: 100%; min-height: 3.25rem; padding: .6rem 1rem; border: 0; border-radius: 1.1rem;
  background: #fff; color: var(--ink); font: inherit; box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #2b6cb0; outline-offset: 1px; }
.field { display: block; margin-bottom: .85rem; font-weight: 600; }
.field input, .field select { margin-top: .3rem; font-weight: 400; }
.dates { margin-top: .75rem; font-weight: 600; white-space: pre-wrap; }
fieldset { margin: 1.25rem 0 0; padding: 0; border: 0; }
legend { margin-bottom: .6rem; padding: 0; font-weight: 700; }
.choices label, .check { display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.choices label { min-height: 3.25rem; margin-bottom: .55rem; padding: .65rem 1rem; border: 2px solid transparent; border-radius: 1.1rem; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.choices label:has(:checked) { border-color: var(--ion-color-primary); background: #f8eef2; }
.choices label:focus-within, .file:focus-within { outline: 3px solid #2b6cb0; outline-offset: 2px; }
input[type="radio"], input[type="checkbox"] { flex: none; width: 1.3rem; height: 1.3rem; accent-color: var(--ion-color-primary); }
.check { margin: 1rem 0 .5rem; }
.checks { padding: .25rem 1rem; border-radius: 1.4rem; background: #fff; }
.checks legend { float: left; width: 100%; margin: .75rem 0 .25rem; }
.checks label { display: flex; clear: both; align-items: flex-start; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checks label:last-child { border-bottom: 0; }
.checks input:disabled + span { color: var(--soft); }
.state { margin-top: .9rem; color: var(--warn); }
.state.ok { color: var(--ok); font-weight: 700; }

/* Files. */
.picker ul { margin: 0; padding: 0; list-style: none; }
.picker li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .5rem; padding: .7rem 1rem; border-radius: 1.1rem; background: #fff; overflow-wrap: anywhere; }
.picker small { display: block; color: var(--soft); font-size: .8rem; }
.picker small.rejected { color: #a4161a; }
.picker .remove { min-height: 2.75rem; border: 0; background: none; color: var(--ion-color-primary); font: inherit; font-weight: 600; cursor: pointer; }
.file, .download { position: relative; display: block; margin-top: .6rem; padding: 1.1rem 1rem; border-radius: 1.4rem; background: rgb(91 31 58 / .09); color: var(--ion-color-primary); font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.template { margin-top: 1.25rem; padding: 1rem; border-radius: 1.4rem; background: rgb(255 255 255 / .75); }
progress { width: 100%; height: .75rem; accent-color: var(--ion-color-primary); }

/* Example document. */
dialog { width: min(92vw, 30rem); max-height: 90vh; padding: 1rem; border: 0; border-radius: 1.6rem; color: var(--ink); background: #fff; }
dialog::backdrop { background: rgb(27 31 42 / .45); backdrop-filter: blur(6px); }
.sample { position: relative; overflow: hidden; margin-bottom: .75rem; padding: .5rem 1rem; border: 1px solid var(--line); font-size: .95rem; }
.sample::after { content: "ÖRNEK"; position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-24deg); color: rgb(91 31 58 / .14); font-size: 4.5rem; font-weight: 800; pointer-events: none; }
.sample h2 { margin-top: .5rem; font-size: 1.1rem; }
.sample .row { display: grid; grid-template-columns: 8rem 1fr; gap: .5rem; border-bottom: 1px dotted var(--line); }
.sample .row span { color: var(--soft); }
.sample .table { overflow-x: auto; margin: .5rem 0; }
.sample table { border-collapse: collapse; font-size: .8rem; }
.sample th, .sample td { padding: .25rem .4rem; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.photo { float: right; width: 5.5rem; height: 7rem; margin: 0 0 .5rem .75rem; display: grid; place-items: center; border: 2px solid var(--soft); color: var(--soft); font-size: .8rem; text-align: center; }
.signing { clear: both; display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: 2.75rem; }
.signature { flex: 1; min-width: 7rem; border-top: 1px solid var(--ink); text-align: center; font-size: .85rem; }
.signature i { display: block; margin-top: -1.8rem; font-family: cursive; font-size: 1.05rem; }
.seal { width: 6rem; height: 6rem; margin: 0 auto; display: grid; place-items: center; border: 3px double #7a1f1f; border-radius: 50%; color: #7a1f1f; font-size: .8rem; text-align: center; }

/* Live passport scan: the camera picture with the page outline and the strip for the two lines. */
.scan { position: relative; width: fit-content; max-width: 100%; margin: .6rem auto 0; border-radius: 1.4rem; overflow: hidden; background: #000; }
/* The box is exactly the picture, so the outline (in % of it) sits on the right spot. */
.scan-video { display: block; max-width: 100%; max-height: 55vh; width: auto; height: auto; }
.scan-frame { position: absolute; border: 3px solid rgb(255 255 255 / .9); border-radius: .6rem; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .35); }
.scan-band { position: absolute; left: -1%; right: -1%; bottom: -3%; height: 40%; border: 3px solid #3ddc84; border-radius: .4rem; }
.scan-state { min-height: 3em; }

/* Whose details a screen asks for: the child's (green) or the parent's own (purple). */
.subject { display: inline-block; margin: 0 0 .4rem; padding: .3rem .8rem; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.subject.child { background: #dcf5e6; color: #11603a; }
.subject.parent { background: rgb(91 31 58 / .12); color: var(--ion-color-primary); }
.focus-ring { position: absolute; width: 4.5rem; height: 4.5rem; margin: -2.25rem 0 0 -2.25rem; border: 3px solid #ffd60a; border-radius: 50%; pointer-events: none; animation: focus-ring .9s ease-out forwards; }
@keyframes focus-ring { from { transform: scale(1.4); opacity: 1; } to { transform: scale(.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .focus-ring { animation: none; } }
.letters { display: flex; gap: .4rem; margin-top: .5rem; }
.letters button { flex: 1; min-height: 2.75rem; border: 0; border-radius: .8rem; background: rgb(91 31 58 / .09); color: var(--ion-color-primary); font: 600 1.15rem/1 inherit; }

/* Scan feedback: the outline and strip change colour as the reading gets closer. */
.scan-template { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.scan-template rect, .scan-template circle, .scan-template path { stroke: #fff; stroke-width: .6; fill: rgb(255 255 255 / .35); }
.scan-template rect[fill="none"], .scan-template circle, .scan-template path { fill: none; }
.scan-template text { fill: #fff; font: 600 5.1px/1 ui-monospace, Menlo, monospace; letter-spacing: -.05px; }
.scan-frame { transition: border-color .2s; }
.scan-frame[data-state="seen"], .scan-frame[data-state="seen"] .scan-band { border-color: #ffd60a; }
.scan-frame[data-state="checked"], .scan-frame[data-state="checked"] .scan-band,
.scan-frame[data-state="done"], .scan-frame[data-state="done"] .scan-band { border-color: #3ddc84; }
.scan-frame[data-state="done"] { background: rgb(61 220 132 / .25); }
.scan-frame[data-state="done"]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 4rem/1 system-ui; text-shadow: 0 2px 8px rgb(0 0 0 / .5); }
.scan-frame:not([data-state]), .scan-frame[data-state="searching"] { animation: scan-pulse 1.6s ease-in-out infinite; }
@keyframes scan-pulse { 50% { border-color: rgb(255 255 255 / .45); } }
@media (prefers-reduced-motion: reduce) { .scan-frame { animation: none !important; transition: none; } }

/* The privacy notice, read in a box of its own before the form. */
.notice-text { max-height: 55vh; overflow-y: auto; margin: .6rem 0; padding: .4rem 1rem 1rem; border-radius: 1.1rem; background: #fff; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .1); font-size: .95rem; line-height: 1.5; }
.notice-text h1 { font-size: 1.25rem; }
.notice-text h2 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.notice-text table { width: 100%; border-collapse: collapse; }
.notice-text th, .notice-text td { padding: .35rem .3rem; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.notice-text .draft { padding: .5rem .7rem; border-radius: .6rem; background: #fdf3e3; color: #8a4b00; }
.consent { margin-top: .8rem; padding: .8rem 1rem; border-radius: 1.1rem; background: rgb(91 31 58 / .06); font-size: .95rem; }

.why { margin: .5rem 0 1rem; font-size: .9rem; color: var(--soft); }
.why summary { list-style: none; cursor: pointer; color: var(--accent, #5b1f3a); font-weight: 600; }
.why summary::before { content: "ⓘ "; }
.why p { margin: .4rem 0 0; }
.trip { margin-bottom: 1.25rem; padding: 1rem 1.1rem; border-radius: 1.1rem; background: rgb(91 31 58 / .06); }
.trip h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.trip .dates { margin-top: .4rem; }
.program { margin: .6rem 0 0; white-space: pre-line; }
.why summary::-webkit-details-marker { display: none; }
.page-no { margin: 0 0 .25rem; text-align: right; font-size: .75rem; font-weight: 600; color: var(--soft); }
.scan-frame.id .scan-band { height: 56%; }
.trip-row { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 1rem; }
.trip-row legend { padding: 0 .3rem; font-weight: 700; }
.money { display: flex; gap: .5rem; align-items: center; }
.money input { flex: 1; }
.file.primary { background: var(--ion-color-primary); color: #fff; }
.intro { padding: 1.5rem 0 .5rem; }
.intro-icon { font-size: 3.5rem; line-height: 1; margin-bottom: .75rem; }
.intro h1 { font-size: 1.9rem; }
.intro.child h1 { color: #1f6b3a; }
.intro p { font-size: 1.1rem; }
.composer { margin: 2.5rem 0 .5rem; }
.composer-box { display: flex; align-items: flex-end; gap: .5rem; padding: .55rem .6rem .55rem .9rem; border: 1px solid var(--line); border-radius: 1.2rem; background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .06); }
.composer-box:focus-within { border-color: #d97757; }
.composer textarea { flex: 1; min-height: 1.6rem; padding: .25rem 0; border: 0; outline: 0; resize: none; background: none; font: inherit; line-height: 1.4; }
.composer .spark { color: #d97757; font-size: 1.2rem; line-height: 2rem; }
.composer .attach { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; }
.composer .attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer .send { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: #d97757; color: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.composer .send:disabled { background: rgb(217 119 87 / .35); cursor: default; }
.composer .hint { margin: .35rem .3rem 0; font-size: .8rem; }
