/* The Resume maker (resume-maker and its Hindi twin). The colours are the page's (--bg, --bg-2, --border, --accent ...). */
/* the words that say something happened: the green, the amber and the red of the dark page are too pale to read on a white page, so the light page has darker ones (4.5 : 1 or more) */
:root { --rm-ok: var(--accent); --rm-warn: #ffb454; --rm-err: #ff8a8a; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --rm-ok: #0b7a4b; --rm-warn: #a85a00; --rm-err: #b3261e; } }
:root[data-theme="light"] { --rm-ok: #0b7a4b; --rm-warn: #a85a00; --rm-err: #b3261e; }

.rm { margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2); scroll-margin-top: 72px; }
@media (min-width: 700px) { .rm { padding: 22px; } }
@media (max-width: 480px) { .rm { margin-inline: -8px; padding: 10px 8px; } }
.rm-nojs { color: var(--text-2); }
.rm button, .rm input, .rm select, .rm textarea { font-family: inherit; }
.rm-title { margin-bottom: 8px; font-size: 15px; font-weight: 700; }
label.rm-title { display: block; }

/* the look: the template (a small drawing of its page), the colour and the size of the letters */
.rm-look { display: grid; gap: 16px; }
@media (min-width: 760px) { .rm-look { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.rm-tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rm-tpl { position: relative; display: block; -webkit-tap-highlight-color: transparent; }
.rm-tpl input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rm-tpl > span { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); text-align: center; }
.rm-tpl svg { display: block; width: 54px; height: 72px; }
.rm-tpl b { font-size: 14px; line-height: 1.25; }
.rm-tpl input:checked + span { border-color: var(--accent); background: var(--accent-lo); box-shadow: 0 0 0 1px var(--accent); }
.rm-tpl input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rm-tpl .pg { fill: #fff; stroke: #c4c4d2; }                 /* (the paper stays white on the dark page too: it is a sheet of paper) */
.rm-tpl .ink { fill: #3b3b4a; } .rm-tpl .soft { fill: #d2d2de; } .rm-tpl .acc { fill: var(--rm-acc); } .rm-tpl .band { fill: #fff; } .rm-tpl .side { fill: #ececf4; } .rm-tpl .photo { fill: #c9c4e6; }
.rm-tpl-d { margin-top: 8px; min-height: 3em; font-size: 13px; line-height: 1.5; color: var(--text-2); }
/* on a phone the page of the resume is below the boxes: a link takes the person to it (beside the boxes on a wide screen, so no link there) */
.rm-jump { display: inline-flex; align-items: center; min-height: 44px; margin-top: 2px; color: var(--rm-ok); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.rm-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 960px) { .rm-jump { display: none; } }
.rm-out { scroll-margin-top: 72px; }
.rm-style { display: grid; gap: 14px; }
.rm-colors { display: flex; flex-wrap: wrap; gap: 2px; margin-inline: -2px; }
.rm-color { position: relative; display: grid; place-items: center; width: 44px; height: 44px; -webkit-tap-highlight-color: transparent; }
.rm-color input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rm-color i { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--border); }
.rm-color input:checked + i { box-shadow: 0 0 0 2px var(--text); }
.rm-color input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.rm-sizebox { display: grid; gap: 0; }

/* the boxes (below the look on a phone) and the page of the resume (beside them on a wide screen) */
.rm-grid { display: grid; gap: 18px; margin-top: 18px; }
@media (min-width: 960px) { .rm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: start; } .rm-out { position: sticky; top: 84px; } }
.rm-form, .rm-out { min-width: 0; }

.rm-sec { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.rm-sec > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 700; }
.rm-sec > summary::-webkit-details-marker { display: none; }
.rm-sec > summary::after { content: '+'; margin-left: auto; padding-left: 8px; color: var(--rm-ok); font-size: 22px; line-height: 1; }
.rm-sec[open] > summary::after { content: '−'; }
.rm-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.rm-cnt { font-size: 13px; font-weight: 600; color: var(--text-2); }
.rm-cnt.bad { color: var(--rm-err); }
.rm-sec:has([aria-invalid="true"]) { border-color: var(--rm-err); }
.rm-body { display: grid; gap: 12px; min-width: 0; padding: 2px 14px 14px; }
.rm-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
@media (min-width: 420px) { .rm-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rm-row { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 0; align-content: start; }
.rm-row.fit { grid-column: auto; }
.rm-row > label { font-size: 14px; font-weight: 600; }
.rm input[type="text"], .rm textarea, .rm select { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4; }
.rm-sec input[type="text"], .rm-sec textarea { background: var(--bg-2); }
.rm textarea { resize: vertical; line-height: 1.5; }
.rm input:focus, .rm textarea:focus, .rm select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rm input::placeholder, .rm textarea::placeholder { color: var(--text-2); opacity: .8; }
.rm input:disabled { opacity: .5; }
.rm [aria-invalid="true"] { border-color: var(--rm-err); }
.rm-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; }
.rm-check input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.rm-help { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.rm-err { font-size: 13px; line-height: 1.5; font-weight: 600; color: var(--rm-err); overflow-wrap: anywhere; }

/* the jobs, courses, projects and certificates: one card each */
.rm-list { display: grid; gap: 10px; }
.rm-list:empty { display: none; }
.rm-entry { display: grid; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.rm-sec .rm-entry { background: var(--bg-2); }
.rm-sec .rm-entry input[type="text"], .rm-sec .rm-entry textarea { background: var(--bg); }
.rm-ehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rm-etitle { font-size: 14px; font-weight: 700; }
.rm-add { justify-self: start; }

/* the photo of the Photo CV */
.rm-pbox { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.rm-thumb { display: block; width: 70px; height: 90px; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-2); }
.rm-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rm-pbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-file { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* what is kept on this device, and the button that deletes it */
.rm-keep { display: grid; justify-items: start; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.rm .rm-wipe[data-armed="1"], .rm .rm-wipe[data-armed="1"]:hover { border-color: var(--rm-err); color: var(--rm-err); }          /* (also while a finger or a mouse is still on it: the hover colours of a button would otherwise win) */

/* the page of the resume: a box that keeps the proportions of an A4 sheet while it loads, so that nothing below it moves when the page comes */
.rm-example { margin-bottom: 8px; padding: 8px 0 8px 12px; border-left: 3px solid var(--rm-warn); font-size: 14px; line-height: 1.5; color: var(--rm-warn); font-weight: 600; }
.rm-stage { position: relative; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.rm-pages { display: grid; gap: 12px; min-width: 0; }
.rm-pages canvas { display: block; width: 100%; height: auto; border-radius: 2px; background: #fff; box-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.rm-stage[data-state="stale"] .rm-pages canvas { opacity: .4; }
.rm-ph { display: none; width: 100%; aspect-ratio: 595.28 / 841.89; }         /* (the place of the page while it is not there: the same height as the page when it comes, so nothing below it moves) */
.rm-stage[data-state="loading"] .rm-ph, .rm-stage[data-state="empty"] .rm-ph, .rm-stage[data-state="fail"] .rm-ph { display: block; }
.rm-stage[data-state="loading"] .rm-pages, .rm-stage[data-state="empty"] .rm-pages, .rm-stage[data-state="fail"] .rm-pages { display: none; }
.rm-msg { position: absolute; inset: 11px; display: grid; place-content: center; padding: 16px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.rm-stage[data-state="ready"] .rm-msg, .rm-stage[data-state="stale"] .rm-msg { display: none; }
@media (min-width: 960px) { .rm-pages { max-height: calc(100vh - 230px); min-height: 200px; overflow: auto; overscroll-behavior: contain; } }
.rm-meta { min-height: 1.4em; margin-top: 8px; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--text-2); text-align: center; }
.rm-meta.warn { color: var(--rm-warn); }

.rm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.rm .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: transparent; }
.rm .btn-primary { background: var(--accent); border: 0; color: #08080E; }
.rm .btn-ghost { border: 1px solid var(--border); color: var(--text); }
.rm .btn-ghost:hover { border-color: var(--accent); color: var(--rm-ok); }
.rm .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rm-status { min-height: 1.4em; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--rm-ok); text-align: center; }
.rm-keep .rm-status, .rm-photo .rm-status { text-align: left; }
.rm-status.warn { color: var(--rm-warn); }
html[lang="hi"] .rm-title { font-size: 16px; }
