@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=DM+Sans:wght@400;500;600&family=Pinyon+Script&display=swap');

:root {
    --ink: #27332d;
    --muted: #667269;
    --sage: #78866d;
    --sage-dark: #566550;
    --paper: #f5f1eb;
    --line: #d9ddd3;
    --white: #fffdf9;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
}
a { color: inherit; text-decoration: none; }

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
    overflow: hidden;
}
.auth-page.register-page { grid-template-columns: minmax(420px, .92fr) minmax(0, 1.08fr); }

.auth-visual {
    position: relative;
    min-height: 100vh;
    padding: 34px clamp(28px, 5vw, 76px);
    display: flex;
    align-items: flex-end;
    background: #d7ddd0;
    overflow: hidden;
}
.register-page .auth-visual { grid-column: 2; grid-row: 1; }
.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(25, 38, 31, .22), transparent 38%, rgba(25, 38, 31, .6));
    z-index: 1;
    pointer-events: none;
}
.login-page .auth-visual::after {
    content: '';
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -35%;
    width: 22%;
    z-index: 1;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
    transform: skewX(-18deg);
    animation: lightSweep 9s 1.8s ease-in-out infinite;
    pointer-events: none;
}
.mosaic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.18fr .82fr;
    grid-template-rows: 1.08fr .92fr;
    gap: 0;
    padding: clamp(30px, 5vw, 78px);
    animation: mosaicIn 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.mosaic img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 10px solid rgba(255, 253, 249, .92);
    box-shadow: 0 18px 38px rgba(21, 31, 25, .23);
    filter: saturate(.78) contrast(.96);
    transform: scale(1.04);
    animation: photoReveal .9s cubic-bezier(.2,.75,.2,1) forwards, kenBurns 14s 1.2s ease-in-out infinite alternate;
    transition: transform .8s ease, filter .8s ease;
    will-change: transform;
}
.mosaic img:first-child {
    grid-row: 1 / 3;
    transform: translate(-4%, 2%) rotate(-2.4deg) scale(1.04);
    z-index: 2;
}
.login-page .mosaic img:first-child { object-position: 46% center; }
.login-page .mosaic img:first-child { animation-delay: 0s, 4s; }
.mosaic img:nth-child(2) {
    transform: translate(5%, -5%) rotate(2.8deg) scale(1.04);
    z-index: 1;
    animation-delay: .22s, 2s;
}
.login-page .mosaic img:nth-child(2) { object-position: 58% center; }
.login-page .mosaic img:nth-child(2) { animation-delay: .25s, 5s; }
.mosaic img:nth-child(3) {
    transform: translate(8%, 4%) rotate(-1.8deg) scale(1.04);
    z-index: 3;
    animation-delay: .44s, 3s;
}
.login-page .mosaic img:nth-child(3) { object-position: 42% center; }
.login-page .mosaic img:nth-child(3) { animation-delay: .5s, 6s; }
.mosaic img:nth-child(4) {
    transform: translate(-2%, 7%) rotate(2.2deg) scale(1.04);
    z-index: 4;
    animation-delay: .66s, 4s;
}
.login-page .mosaic img:nth-child(4) { object-position: 55% center; }
.login-page .mosaic img:nth-child(4) { animation-delay: .75s, 7s; }
.register-page .mosaic img:first-child { animation-delay: 0s, 4s; }
.register-page .mosaic img:nth-child(2) { animation-delay: .25s, 5s; }
.register-page .mosaic img:nth-child(3) { animation-delay: .5s, 6s; }
.register-page .mosaic img:nth-child(4) { animation-delay: .75s, 7s; }
.auth-visual:hover .mosaic img { filter: saturate(.95) contrast(1.04); }
.auth-visual:hover .mosaic img:first-child { transform: translate(-4%, 2%) rotate(-2.4deg) scale(1.08); }
.auth-visual:hover .mosaic img:nth-child(2) { transform: translate(5%, -5%) rotate(2.8deg) scale(1.08); }
.auth-visual:hover .mosaic img:nth-child(3) { transform: translate(8%, 4%) rotate(-1.8deg) scale(1.08); }
.auth-visual:hover .mosaic img:nth-child(4) { transform: translate(-2%, 7%) rotate(2.2deg) scale(1.08); }
.visual-brand, .visual-copy { position: relative; z-index: 2; color: #fff; }
.visual-brand {
    position: absolute;
    top: 31px;
    left: clamp(28px, 5vw, 76px);
    font-family: 'Cinzel', serif;
    font-size: .75rem;
    letter-spacing: .19em;
    text-transform: uppercase;
}
.visual-brand span { color: #d9e0d0; }
.visual-copy { max-width: 530px; animation: riseIn .9s .25s ease both; }
.visual-kicker { margin: 0 0 10px; font-family: 'Pinyon Script', cursive; font-size: clamp(2rem, 4vw, 3.6rem); }
.visual-copy h2 { margin: 0; font-family: 'Cinzel', serif; font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.8rem); line-height: 1.2; letter-spacing: .04em; }
.visual-copy p { max-width: 410px; margin: 16px 0 0; font-size: .85rem; line-height: 1.7; color: rgba(255,255,255,.86); }

.auth-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 34px clamp(28px, 6vw, 94px) 30px;
    background: var(--paper);
    animation: panelIn .8s .1s ease both;
}
.login-page .auth-panel { animation-delay: 1.35s; }
.register-page .auth-panel { grid-column: 1; grid-row: 1; }
.register-page .auth-panel { animation-delay: 1.35s; }
.auth-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: auto; }
.auth-nav-logo { font-family: 'Cinzel', serif; font-size: .73rem; letter-spacing: .13em; text-transform: uppercase; color: var(--sage-dark); }
.auth-links { display: flex; gap: 18px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.auth-links a { transition: color .2s ease; }
.auth-links a:hover, .auth-links .active { color: var(--sage-dark); }
.auth-content { width: 100%; max-width: 410px; margin: clamp(50px, 10vh, 120px) auto; }
.auth-eyebrow { margin: 0 0 13px; color: var(--sage-dark); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }
.auth-content h1 { margin: 0; font-family: 'Cinzel', serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 400; letter-spacing: .04em; line-height: 1.15; }
.auth-intro { margin: 17px 0 36px; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.auth-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { color: var(--ink); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.field input { width: 100%; border: 0; border-bottom: 1px solid #aeb8aa; border-radius: 0; padding: 11px 0; outline: none; background: transparent; color: var(--ink); font: inherit; transition: border-color .25s ease, box-shadow .25s ease; }
.field input:focus { border-color: var(--sage-dark); box-shadow: 0 2px 0 var(--sage-dark); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: -2px; color: var(--muted); font-size: .75rem; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { accent-color: var(--sage-dark); }
.text-link { color: var(--sage-dark); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.text-link:hover { border-color: currentColor; }
.auth-button { border: 1px solid var(--sage-dark); padding: 15px 22px; background: var(--sage-dark); color: #fff; cursor: pointer; font: 500 .72rem 'DM Sans', sans-serif; letter-spacing: .17em; text-transform: uppercase; transition: background .25s ease, color .25s ease, transform .25s ease; }
.auth-button:hover { background: transparent; color: var(--sage-dark); transform: translateY(-2px); }
.auth-status { min-height: 20px; margin: 0; color: var(--sage-dark); font-size: .76rem; }
.auth-switch { margin: 34px 0 0; color: var(--muted); font-size: .8rem; }
.auth-switch a { color: var(--sage-dark); font-weight: 600; }
.auth-footer { display: flex; justify-content: space-between; color: #889287; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }

@keyframes mosaicIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
@keyframes photoReveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes kenBurns { from { object-position: 48% 48%; } to { object-position: 54% 52%; } }
@keyframes lightSweep { 0%, 68%, 100% { left: -35%; opacity: 0; } 74% { opacity: 1; } 88% { left: 118%; opacity: 0; } }
@keyframes panelIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
    .auth-page, .auth-page.register-page { display: flex; flex-direction: column; min-height: 100vh; }
    .auth-visual, .register-page .auth-visual { order: 1; min-height: 48vh; height: 48vh; }
    .auth-panel, .register-page .auth-panel { order: 2; min-height: auto; padding: 25px 25px 28px; }
    .auth-content { margin: 54px auto 58px; }
    .auth-links a:nth-child(-n+3) { display: none; }
    .visual-copy h2 { max-width: 330px; }
    .auth-footer { margin-top: auto; }
    .mosaic { padding: 18px; }
    .mosaic img { border-width: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
