/* Registration page only: compact layout, green backdrop and a white sign-in card. */
:root {
    color-scheme: light;
    --pf-green: #008d50;
    --pf-ink: #112e21;
    --pf-muted: #62766a;
    --pf-line: #d0e2d2;
    --pf-backdrop: #edf5ed;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--pf-backdrop);
    color: var(--pf-ink);
    font:
        16px/1.5 'DM Sans',
        Arial,
        sans-serif;
}
button,
input {
    font: inherit;
}
button,
summary {
    cursor: pointer;
}
button:disabled {
    cursor: wait;
}
a {
    color: inherit;
}
[hidden] {
    display: none !important;
}
h1,
h2,
p {
    margin: 0;
}
:focus-visible {
    outline: 3px solid var(--pf-green);
    outline-offset: 4px;
}
.pf-skip {
    position: absolute;
    left: 20px;
    top: -100px;
    z-index: 20;
    background: white;
    padding: 12px 18px;
    border-radius: 12px;
}
.pf-skip:focus {
    top: 16px;
}
#pf-register {
    max-width: 1240px;
    min-height: 100svh;
    margin: auto;
    padding: 24px 40px 16px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
}
.pf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.pf-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1.3px;
    text-decoration: none;
}
.pf-brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding-bottom: 5px;
    border-radius: 18px 18px 18px 5px;
    background: var(--pf-green);
    color: white;
    font-size: 35px;
    line-height: 1;
}
.pf-tagline {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4e7061;
    font-size: 13px;
}
.pf-dot {
    display: inline-block;
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pf-green);
    box-shadow: 0 0 0 4px #dceedd;
}
#pf-register main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 10px 42px;
    align-content: center;
    align-items: center;
    min-width: 0;
}
.pf-intro {
    grid-column: 1;
    grid-row: 1;
}
.pf-eyebrow {
    margin-bottom: 8px;
    color: var(--pf-green);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
}
.pf-intro h1 {
    font-size: clamp(48px, 5.5vw, 76px);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -4px;
}
.pf-intro h1 em {
    font-family: 'Instrument Serif', Georgia, serif;
    color: var(--pf-green);
    font-weight: 400;
    letter-spacing: -2px;
}
.pf-intro-bottom {
    margin-top: 12px;
}
.pf-intro-bottom p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--pf-muted);
}
.pf-intro-rule {
    display: none;
}
.pf-content {
    display: contents;
}
.pf-art {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}
.pf-scene {
    position: relative;
    width: min(100%, 42svh, 400px);
    aspect-ratio: 1;
    margin: 0 auto;
    isolation: isolate;
}
.pf-sphere {
    position: absolute;
    z-index: -1;
    left: 6%;
    top: 18%;
    width: 88%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(150deg, #dbff9c, #b6efcd);
    transform: scaleY(0.9);
}
.pf-orbit {
    position: absolute;
    z-index: -1;
    left: 0;
    top: 29%;
    width: 100%;
    height: 65%;
    border: 1px solid #b0d7ba;
    border-radius: 50%;
    transform: rotate(-17deg);
}
.pf-food {
    position: absolute;
    top: -3%;
    left: -3%;
    width: 106%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 12px 14px #163e2616);
    pointer-events: none;
}
.pf-food-floating {
    z-index: 3;
    clip-path: polygon(0 0, 100% 0, 100% 43%, 65% 43%, 65% 40%, 43% 40%, 43% 43%, 0 43%);
    opacity: 0;
    transform: translateY(25%) scale(0.65);
    transform-origin: 50% 65%;
}
.pf-food-bowl {
    z-index: 2;
    clip-path: polygon(0 43%, 43% 43%, 43% 40%, 65% 40%, 65% 43%, 100% 43%, 100% 100%, 0 100%);
}
[data-food='ready'] .pf-food-floating {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.pf-ingredient-label {
    position: absolute;
    z-index: 4;
    top: 19%;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #d3e4d6;
    border-radius: 99px;
    background: white;
    color: #3f6750;
    font-size: 11px;
    box-shadow: 0 6px 22px #203d2710;
}
.pf-ingredient-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pf-green);
}
.pf-scene-bottom {
    margin-top: 20px;
    text-align: center;
}
.pf-scene-bottom p {
    font-size: 12px;
    line-height: 1.5;
    color: var(--pf-muted);
}
.pf-card {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-self: end;
    align-self: center;
    width: 100%;
    max-width: 440px;
    min-width: 0;
    padding: 30px 32px;
    border: 1px solid #bed7c3;
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 20px 55px #215e3820,
        0 3px 10px #215e380a;
}
.pf-card h2 {
    font-size: 27px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.6px;
}
.pf-card-description {
    margin: 6px 0 20px;
    color: #718278;
    font-size: 13px;
    line-height: 1.6;
}
.pf-field {
    position: relative;
    margin-bottom: 14px;
}
.pf-field label {
    display: block;
    margin-bottom: 6px;
    color: #536d5e;
    font-size: 12px;
    font-weight: 500;
}
.pf-field input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 40px 0 13px;
    border: 1px solid #d8e5da;
    border-radius: 9px;
    background: #f8fbf8;
    color: var(--pf-ink);
    font-size: 14px;
    line-height: normal;
}
.pf-field input::placeholder {
    color: #87978c;
    opacity: 1;
}
.pf-field input:focus {
    outline: 2px solid var(--pf-green);
    outline-offset: 2px;
    background: #fff;
}
.pf-field:focus-within label {
    color: var(--pf-green);
}
.pf-field-check {
    position: absolute;
    display: grid;
    place-items: center;
    right: 13px;
    bottom: 15px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pf-green);
    color: white;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
}
.pf-field[data-valid='true'] .pf-field-check {
    opacity: 1;
}
.pf-field[data-valid='true'] input {
    border-color: #9fc9ae;
}
.pf-password-field input {
    padding-right: 66px;
}
.pf-password-toggle {
    position: absolute;
    right: 2px;
    bottom: 1px;
    min-height: 44px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #4d715b;
    font-size: 12px;
}
.pf-password-toggle:hover {
    background: #eaf4eb;
}
.pf-caps {
    margin: -4px 0 10px;
    color: #875017;
    font-size: 12px;
}
.pf-password-help {
    margin: -6px 0 12px;
    font-size: 12px;
    color: #61776a;
}
.pf-password-help summary {
    display: block;
    width: fit-content;
    margin-left: auto;
    padding: 8px 0;
    list-style: none;
}
.pf-password-help summary::-webkit-details-marker {
    display: none;
}
.pf-password-help summary:hover {
    color: var(--pf-green);
    text-decoration: underline;
}
.pf-password-help p {
    margin-top: 4px;
    padding: 10px;
    border-radius: 8px;
    background: #f1f7ef;
    line-height: 1.6;
}
.pf-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--pf-green);
    color: #fff;
    box-shadow: 0 5px 14px #008d501a;
    font-size: 14px;
    font-weight: 600;
}
.pf-submit:not(:disabled):hover {
    background: #007944;
}
.pf-submit:disabled {
    opacity: 0.55;
}
.pf-signup {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e4eee5;
    color: #6c8073;
    font-size: 12px;
}
.pf-signup a {
    padding: 5px 0;
    color: var(--pf-green);
    font-weight: 700;
    text-decoration: none;
}
.pf-signup a:hover {
    text-decoration: underline;
}
.pf-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #e9b8a5;
    border-radius: 8px;
    background: #fff4ef;
    color: #85371c;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.pf-alert.success {
    border-color: #c0dfc5;
    background: #eff8f0;
    color: #285e39;
}
.pf-retry {
    margin: 0 0 14px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #bdd6c3;
    border-radius: 8px;
    background: #fff;
    color: var(--pf-green);
    font-size: 12px;
}
.pf-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid #d4e4d6;
    color: var(--pf-muted);
    font-size: 11px;
}
.pf-footer > span:last-child {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pf-footer .pf-dot {
    width: 5px;
    height: 5px;
    box-shadow: none;
}
@media (prefers-reduced-motion: no-preference) {
    .pf-food-floating {
        transition:
            transform 1.5s cubic-bezier(0.22, 0.65, 0.3, 1) 0.18s,
            opacity 0.85s ease 0.18s;
    }
    .pf-submit,
    .pf-password-toggle {
        transition: background 0.2s;
    }
}
@media (min-width: 761px) and (max-height: 760px) {
    #pf-register {
        padding-top: 16px;
        padding-bottom: 12px;
        gap: 12px;
    }
    .pf-intro h1 {
        font-size: clamp(44px, 5vw, 66px);
    }
    .pf-intro-bottom {
        margin-top: 8px;
    }
    .pf-scene {
        width: min(100%, 34svh, 270px);
    }
    .pf-scene-bottom {
        margin-top: 16px;
    }
    .pf-card {
        padding: 20px 28px;
    }
    .pf-card-description {
        margin-bottom: 14px;
    }
    .pf-field {
        margin-bottom: 10px;
    }
    .pf-signup {
        margin-top: 12px;
        padding-top: 8px;
    }
}
@media (max-width: 960px) and (min-width: 761px) {
    #pf-register {
        padding-left: 24px;
        padding-right: 24px;
    }
    #pf-register main {
        gap: 10px 24px;
    }
    .pf-card {
        padding: 24px;
    }
    .pf-intro h1 {
        letter-spacing: -2.5px;
    }
}
/* Small screens prioritize the complete form. Nothing is clipped or scroll-locked. */
@media (max-width: 760px) {
    #pf-register {
        max-width: 520px;
        padding: 18px 20px 12px;
        gap: 16px;
    }
    .pf-brand {
        font-size: 25px;
    }
    .pf-brand-mark {
        width: 32px;
        height: 32px;
        font-size: 29px;
    }
    .pf-tagline,
    .pf-art,
    .pf-intro-bottom {
        display: none;
    }
    #pf-register main {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 16px;
    }
    .pf-intro h1 {
        font-size: 42px;
        letter-spacing: -2px;
    }
    .pf-eyebrow {
        font-size: 10px;
        letter-spacing: 1.4px;
        margin-bottom: 6px;
    }
    .pf-card {
        align-self: center;
        max-width: 440px;
        padding: 24px;
        border-radius: 20px;
    }
    .pf-field input {
        font-size: 16px;
    }
    .pf-footer {
        font-size: 10px;
        align-items: flex-start;
    }
    .pf-footer > span:last-child {
        max-width: 155px;
    }
}
@media (max-width: 360px) {
    #pf-register {
        padding: 12px 14px;
        gap: 12px;
    }
    .pf-card {
        padding: 20px;
    }
    .pf-intro h1 {
        font-size: 36px;
    }
    .pf-card-description {
        font-size: 12px;
    }
}
@media (max-width: 760px) and (max-height: 740px) {
    .pf-intro {
        display: none;
    }
    .pf-card {
        padding: 20px;
    }
    .pf-card-description {
        margin-bottom: 14px;
    }
    .pf-field {
        margin-bottom: 10px;
    }
    .pf-signup {
        margin-top: 12px;
        padding-top: 8px;
    }
}

/* Registration-specific form layout; existing auth.js owns the submit flow. */
.pf-intro h1 {
    font-size: clamp(40px, 4.4vw, 60px);
    letter-spacing: -2.8px;
}
.pf-card {
    max-width: 450px;
    padding: 24px 26px;
}
.pf-card h2 {
    font-size: 25px;
}
.pf-card-description {
    margin: 5px 0 16px;
    font-size: 12px;
}
.register-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}
.pf-field {
    margin-bottom: 10px;
}
.pf-field label {
    font-size: 12px;
    margin-bottom: 4px;
}
.pf-field input {
    height: 40px;
    padding-left: 38px;
    font-size: 13px;
}
.register-control {
    position: relative;
}
.register-icon {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 16px;
    height: 16px;
    color: #81958a;
    pointer-events: none;
}
.register-eye {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #71877b;
}
.register-eye:hover {
    background: #eaf4eb;
}
.register-eye[aria-pressed='true'] {
    color: var(--pf-green);
    background: #edf7ee;
}
.register-eye svg,
.pf-submit svg {
    width: 18px;
    height: 18px;
}
.register-password input {
    padding-right: 46px;
}
.auth-strength {
    margin: -2px 0 12px;
}
.auth-req {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 10px;
    line-height: 1.55;
    color: #73887b;
}
.auth-req li {
    display: flex;
    gap: 7px;
    align-items: center;
}
.auth-req li::before {
    content: '';
    display: inline-block;
    flex: none;
    width: 7px;
    height: 7px;
    border: 1px solid #83b895;
    border-radius: 50%;
}
.auth-req li.ok {
    color: #176a40;
}
.auth-req li.ok::before {
    background: var(--pf-green);
    border-color: var(--pf-green);
}
.pf-submit {
    min-height: 44px;
    gap: 10px;
    margin-top: 6px;
    background: linear-gradient(115deg, #008d50, #006f47);
}
.pf-signup {
    margin-top: 14px;
    padding-top: 10px;
}
.pf-alert {
    margin-bottom: 12px;
}
.pf-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid #ffffff80;
    border-top-color: white;
    border-radius: 50%;
}
.is-busy .pf-spinner {
    display: inline-block;
}
@media (prefers-reduced-motion: no-preference) {
    .is-busy .pf-spinner {
        animation: register-spin 0.8s linear infinite;
    }
    @keyframes register-spin {
        to {
            transform: rotate(360deg);
        }
    }
}
@media (min-width: 761px) and (max-height: 760px) {
    .pf-card {
        padding: 20px 24px;
    }
    .pf-card-description {
        margin-bottom: 12px;
    }
    .pf-field {
        margin-bottom: 8px;
    }
    .auth-strength {
        margin-bottom: 10px;
    }
}
@media (max-width: 760px) {
    #pf-register main {
        gap: 12px;
    }
    .pf-card {
        padding: 22px;
    }
    .pf-field input {
        font-size: 16px;
        height: 44px;
    }
    .register-icon {
        top: 14px;
    }
    .register-eye {
        height: 44px;
    }
    .pf-intro h1 {
        font-size: 36px;
    }
    .pf-eyebrow {
        font-size: 9px;
    }
    .pf-intro {
        display: none;
    }
    .register-row {
        gap: 10px;
    }
}
@media (max-width: 360px) {
    .pf-card {
        padding: 18px 16px;
    }
    .pf-card h2 {
        font-size: 23px;
    }
    .register-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Bigger food illustration on desktop */
@media (min-width: 761px) {
    #pf-register .pf-scene {
        width: min(100%, 58svh, 500px);
    }

    #pf-register .pf-scene-bottom {
        margin-top: 18px;
    }
}

/* Email check: message under the field. */
.pf-email-error {
    margin: 6px 0 0;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fdecea;
    color: #8a2a1d;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
}
.pf-email-error[hidden] {
    display: none;
}
input[type='email'][aria-invalid='true'] {
    border-color: #d65a48 !important;
    background: #fffafa !important;
}

.pf-field + .pf-email-error {
    margin: -6px 0 14px;
}
