/* ==========================================================================
   File: assets/css/register.css
   The registration page only.

   Design notes, so the choices are not a mystery later:

   - No icon font. Icons beside every label carry no information the label does
     not already carry, and they pull in a stylesheet the page does not need.
   - Floating labels rather than labels above fields. Halves the vertical space
     a nine field form takes, which matters on a phone.
   - The left panel is not decoration. On a signup page the reason to sign up
     is doing more work than any input, so it gets real estate.
   - One accent, the gold, used sparingly. When everything is highlighted,
     nothing is.
   ========================================================================== */

.reg {
    --reg-green: #2E7D32;
    --reg-dark:  #14331A;
    --reg-gold:  #F9A825;
    --reg-ink:   #241E18;
    --reg-soft:  #7A6A5A;
    --reg-line:  #E4DFD7;
    --reg-page:  #FBFAF8;

    background: var(--reg-page);
    min-height: 100vh;
}

html[data-theme="dark"] .reg {
    --reg-ink:  #EDE7DF;
    --reg-soft: #A4978A;
    --reg-line: #3A322A;
    --reg-page: #17130F;
}

.reg-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

@media (min-width: 960px) {
    .reg-grid { grid-template-columns: 0.9fr 1.1fr; }
}

/* ==========================================================================
   Left panel
   ========================================================================== */

.reg-pitch {
    background:
        radial-gradient(120% 80% at 12% 0%, rgba(249, 168, 37, 0.16) 0%, transparent 55%),
        linear-gradient(155deg, var(--reg-green) 0%, var(--reg-dark) 100%);
    color: #fff;
    padding: 44px 24px 40px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* A single soft shape rather than a pattern. Cheap, and it stops the panel
   reading as a flat block of green on a large screen. */
.reg-pitch::after {
    content: "";
    position: absolute;
    right: -18%;
    bottom: -22%;
    width: 62%;
    aspect-ratio: 1;
    border-radius: 46% 54% 38% 62% / 52% 42% 58% 48%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

@media (min-width: 960px) {
    .reg-pitch { padding: 60px 52px; }
}

.reg-pitch-inner { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; }

.reg-kicker {
    margin: 0 0 22px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--reg-gold);
}

.reg-headline {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: clamp(1.7rem, 5.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
}

.reg-headline em {
    font-style: normal;
    color: var(--reg-gold);
}

.reg-lede {
    margin: 0 0 28px;
    font-size: 0.98rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.86);
}

.reg-points { margin: 0 0 30px; }

.reg-points > div {
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.reg-points > div:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.16); }

.reg-points dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--reg-gold);
    margin-bottom: 5px;
}

.reg-points dd {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86);
}

.reg-note { margin: 0; font-size: 0.86rem; color: rgba(255, 255, 255, 0.72); }
.reg-note a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* On a phone the pitch is a short header, not half the screen */
@media (max-width: 959px) {
    .reg-pitch { padding: 30px 20px 26px; }
    .reg-points, .reg-note, .reg-lede { display: none; }
    .reg-headline { font-size: 1.5rem; margin-bottom: 0; }
    .reg-kicker { margin-bottom: 12px; }
}

/* ==========================================================================
   Right panel
   ========================================================================== */

.reg-form-side {
    padding: 30px 20px 56px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

@media (min-width: 960px) {
    .reg-form-side { padding: 60px 52px; align-items: center; }
}

.reg-form { width: 100%; max-width: 520px; }

.reg-form-head { margin-bottom: 24px; }

.reg-form-head h2 {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--reg-ink);
    margin: 0 0 5px;
}

.reg-form-head p { margin: 0; font-size: 0.88rem; color: var(--reg-soft); }

.reg-error {
    margin: 0 0 20px;
    padding: 13px 16px;
    border-left: 3px solid #C62828;
    background: rgba(198, 40, 40, 0.07);
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #8E1B1B;
}

/* ==========================================================================
   Role choice
   ========================================================================== */

.reg-roles { border: 0; padding: 0; margin: 0 0 18px; }

.reg-roles legend {
    padding: 0;
    margin-bottom: 11px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--reg-soft);
}

.reg-role { display: block; margin-bottom: 8px; cursor: pointer; }

.reg-role input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.reg-role-face {
    display: block;
    position: relative;
    padding: 14px 18px 14px 46px;
    border: 1.5px solid var(--reg-line);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.16s ease, background 0.16s ease;
}

html[data-theme="dark"] .reg-role-face { background: #221D18; }

/* The radio is drawn by hand so it matches the card, rather than sitting in
   the corner as a default browser control at a different size on every OS. */
.reg-role-face::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    border: 2px solid var(--reg-line);
    border-radius: 50%;
    transition: border-color 0.16s ease;
}

.reg-role-face::after {
    content: "";
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--reg-green);
    transition: transform 0.16s ease;
}

.reg-role input:checked + .reg-role-face {
    border-color: var(--reg-green);
    background: rgba(46, 125, 50, 0.05);
}

.reg-role input:checked + .reg-role-face::before { border-color: var(--reg-green); }
.reg-role input:checked + .reg-role-face::after  { transform: translateY(-50%) scale(1); }

.reg-role input:focus-visible + .reg-role-face {
    outline: 2px solid var(--reg-gold);
    outline-offset: 2px;
}

.reg-role-face:hover { border-color: #B9CFBB; }

.reg-role-name {
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--reg-ink);
    margin-bottom: 2px;
}

.reg-role-desc { display: block; font-size: 0.8rem; color: var(--reg-soft); line-height: 1.45; }

.reg-verify-note {
    margin: 0 0 22px;
    padding: 12px 15px;
    background: rgba(249, 168, 37, 0.1);
    border-left: 3px solid var(--reg-gold);
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #6B4A00;
}

html[data-theme="dark"] .reg-verify-note { color: #E7C77E; }

/* ==========================================================================
   Fields
   ========================================================================== */

.reg-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 16px;
    margin-bottom: 4px;
}

@media (min-width: 560px) {
    .reg-row { grid-template-columns: 1fr 1fr; }
    .reg-field-wide { grid-column: 1 / -1; }
}

.reg-field { position: relative; margin-bottom: 18px; }

.reg-field input,
.reg-field select {
    width: 100%;
    padding: 21px 14px 8px;
    border: 1.5px solid var(--reg-line);
    border-radius: 9px;
    background: #fff;
    color: var(--reg-ink);
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: 16px;               /* below 16px, iOS zooms the page on focus */
    line-height: 1.3;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    appearance: none;
}

html[data-theme="dark"] .reg-field input,
html[data-theme="dark"] .reg-field select { background: #221D18; }

.reg-field select { padding-right: 38px; cursor: pointer; }

/* Chevron drawn in CSS rather than loaded as an icon */
.reg-field select + label + .reg-caret,
.reg-field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--reg-soft) 50%),
                      linear-gradient(135deg, var(--reg-soft) 50%, transparent 50%);
    background-position: calc(100% - 19px) calc(50% + 3px), calc(100% - 14px) calc(50% + 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.reg-field label {
    position: absolute;
    left: 15px;
    top: 15px;
    font-size: 0.93rem;
    color: var(--reg-soft);
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.14s ease, color 0.14s ease;
}

/* The label lifts once the field has content or focus. placeholder=" " on the
   input is what makes :placeholder-shown work as a proxy for "is empty". */
.reg-field input:focus + label,
.reg-field input:not(:placeholder-shown) + label,
.reg-field label.is-fixed {
    transform: translateY(-9px) scale(0.76);
}

.reg-field input:focus + label { color: var(--reg-green); }

.reg-field input:focus,
.reg-field select:focus {
    outline: none;
    border-color: var(--reg-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.13);
}

.reg-field small {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--reg-soft);
}

.reg-field.is-wrong input {
    border-color: #C62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

/* ==========================================================================
   Password tools
   ========================================================================== */

.reg-peek {
    position: absolute;
    right: 10px;
    top: 13px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--reg-soft);
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.reg-peek:hover { color: var(--reg-green); background: rgba(46, 125, 50, 0.07); }

.reg-strength { margin-top: 8px; }

.reg-strength-bar {
    height: 3px;
    border-radius: 3px;
    background: var(--reg-line);
    overflow: hidden;
}

.reg-strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: #C62828;
    transition: width 0.22s ease, background 0.22s ease;
}

.reg-strength[data-level="2"] .reg-strength-bar span { width: 40%; background: #EF6C00; }
.reg-strength[data-level="3"] .reg-strength-bar span { width: 70%; background: var(--reg-gold); }
.reg-strength[data-level="4"] .reg-strength-bar span { width: 100%; background: var(--reg-green); }
.reg-strength[data-level="1"] .reg-strength-bar span { width: 18%; }

.reg-strength-word { display: block; margin-top: 5px; font-size: 0.74rem; color: var(--reg-soft); }

.reg-match { display: block; margin-top: 5px; font-size: 0.75rem; }
.reg-match.is-ok  { color: var(--reg-green); }
.reg-match.is-bad { color: #C62828; }

/* ==========================================================================
   Agreement and submit
   ========================================================================== */

.reg-agree {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 6px 0 22px;
    cursor: pointer;
}

.reg-agree input {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-top: 1px;
    accent-color: var(--reg-green);
    cursor: pointer;
}

.reg-agree span { font-size: 0.83rem; line-height: 1.55; color: var(--reg-soft); }
.reg-agree a { color: var(--reg-green); font-weight: 600; text-underline-offset: 2px; }

.reg-submit {
    width: 100%;
    padding: 15px 24px;
    border: 0;
    border-radius: 9px;
    background: var(--reg-green);
    color: #fff;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    min-height: 52px;
    transition: background 0.16s ease, transform 0.12s ease;
}

.reg-submit:hover { background: var(--reg-dark); }
.reg-submit:active { transform: translateY(1px); }
.reg-submit:focus-visible { outline: 3px solid var(--reg-gold); outline-offset: 2px; }
.reg-submit[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.reg-signin {
    margin: 20px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--reg-soft);
}

.reg-signin a { color: var(--reg-green); font-weight: 700; text-underline-offset: 3px; }

@media (min-width: 960px) { .reg-signin { display: none; } }

/* ==========================================================================
   Motion
   ========================================================================== */

.reg-body[data-revealed="1"] { animation: regReveal 0.26s ease; }

@keyframes regReveal {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .reg-body[data-revealed="1"] { animation: none; }
    .reg-role-face,
    .reg-field input,
    .reg-submit { transition: none; }
}
