/* ===================================
   Unruly Movies - Sign in / Sign up pages
   Poster-wall background with a centered card.
   Used by login.html and register.html
   =================================== */

:root {
    --auth-green: var(--primary-color, #4ade80);
    --auth-green-dark: var(--primary-dark, #22c55e);
    --auth-card: rgba(10, 12, 11, 0.86);
    --auth-field: rgba(255, 255, 255, 0.04);
    --auth-line: rgba(255, 255, 255, 0.10);
    --auth-text: #f4f6f5;
    --auth-muted: #9aa49f;
    --tile-w: 150px;
}

html, body {
    min-height: 100%;
}

body.auth-page {
    margin: 0;
    background: #050705;
    color: var(--auth-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Poster wall (background) ---------- */
.poster-wall {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.poster-grid {
    position: absolute;
    inset: -40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr));
    grid-auto-rows: calc(var(--tile-w) * 1.5);
    gap: 10px;
    transform-origin: 50% 50%;
    animation: wall-drift 60s ease-in-out infinite alternate;
}

.poster-tile {
    border-radius: 8px;
    background: #111 center / cover no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.poster-tile.is-loaded {
    opacity: 1;
}

@keyframes wall-drift {
    from { transform: scale(1) translate3d(0, 0, 0); }
    to   { transform: scale(1.08) translate3d(-1.5%, -2%, 0); }
}

/* Dark wash over the posters so the card and text stay readable */
.wall-shade {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 34% 55% at 50% 52%, rgba(5, 7, 5, 0.45), rgba(5, 7, 5, 0) 100%),
        linear-gradient(180deg, rgba(5, 7, 5, 0.75) 0%, rgba(5, 7, 5, 0.12) 18%, rgba(5, 7, 5, 0.12) 78%, rgba(5, 7, 5, 0.8) 100%);
}

/* ---------- Top bar ---------- */
.auth-topbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 22px 32px 0;
    box-sizing: border-box;
}

.auth-brand img {
    display: block;
    height: 38px;
    width: auto;
}

.topbar-signup {
    display: inline-flex;
    align-items: center;
    padding: 10px 22px;
    border: 1.5px solid var(--auth-green);
    border-radius: 10px;
    color: var(--auth-green);
    background: rgba(5, 7, 5, 0.55);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.topbar-signup:hover {
    background: var(--auth-green);
    color: #04140a;
}

/* ---------- Card ---------- */
.auth-container {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 28px;
}

.auth-box {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    padding: 32px 36px 26px;
    background: var(--auth-card);
    border: 1px solid var(--auth-line);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.auth-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 0 0 22px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: var(--auth-muted);
}

/* Google Sign-In Button */
.google-custom-btn {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Google Sans', Roboto, 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.15s, box-shadow 0.15s;
    letter-spacing: 0.25px;
}
.google-custom-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.google-custom-btn:active { background: #f1f3f4; }
.google-custom-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

.divider span {
    padding: 0 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--auth-text);
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background: var(--auth-field);
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    color: var(--auth-text);
    font-size: 16px; /* 16px stops iPhones zooming in on focus */
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--auth-green);
    background: rgba(74, 222, 128, 0.04);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

.form-control::placeholder {
    color: #6b746f;
}

.password-toggle {
    position: relative;
}

.password-toggle .form-control {
    padding-right: 52px;
}

.password-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--auth-muted);
    cursor: pointer;
}

.password-toggle-btn:hover {
    color: var(--auth-green);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 2px 0 18px;
    font-size: 14px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--auth-green);
}

.form-link {
    color: var(--auth-green);
    text-decoration: none;
    font-weight: 600;
}

.form-link:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--auth-green), var(--auth-green-dark));
    color: #04140a;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(74, 222, 128, 0.35);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.auth-switch {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-switch a {
    color: var(--auth-green);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ---------- Sign-up extras ---------- */
.form-control.error {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

.field-hint,
.error-message {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
}

.field-hint {
    color: var(--auth-muted);
}

.error-message {
    display: none;
    color: #ff6b6b;
}

.error-message.show {
    display: block;
}

/* When the password error shows, hide the hint it replaces */
.field-hint:has(+ .error-message.show) {
    display: none;
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--auth-line);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak {
    width: 33%;
    background-color: #ff6b6b;
}

.password-strength-bar.medium {
    width: 66%;
    background-color: #fbbf24;
}

.password-strength-bar.strong {
    width: 100%;
    background-color: var(--auth-green);
}

.terms-check {
    align-items: flex-start;
    margin: 2px 0 6px;
    font-size: 13.5px;
    line-height: 1.5;
}

.terms-check input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.terms-check a {
    color: var(--auth-green);
    text-decoration: none;
    font-weight: 600;
}

.terms-check a:hover {
    text-decoration: underline;
}

#termsError {
    margin: 2px 0 0 26px;
}

.terms-block {
    margin-bottom: 18px;
}

/* ---------- First screen: top bar + card over the posters ---------- */
.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Site footer (links, contacts, follow us) ---------- */
.auth-footer {
    position: relative;
    z-index: 2;
    background: #070908;
    border-top: 1px solid rgba(74, 222, 128, 0.18);
    color: #9aa49f;
    font-size: 14.5px;
}

.auth-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 32px 36px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.4fr 1fr;
    gap: 36px 40px;
}

.af-logo img {
    display: block;
    height: 30px;
    width: auto;
}

.af-tagline {
    margin: 14px 0 18px;
    max-width: 280px;
    line-height: 1.6;
    color: #9aa49f;
}

.af-play img {
    display: block;
    height: 46px;
    width: auto;
    margin-left: -7px; /* the official badge image has built-in padding */
}

.af-heading {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffffff;
}

.af-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.af-list a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #a8b1ac;
    text-decoration: none;
    transition: color 0.2s;
}

.af-list a:hover {
    color: var(--auth-green);
}

/* Small chevron in front of each page link */
.af-pages a::before {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.7;
    flex-shrink: 0;
}

.af-contacts svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #c9d1cc;
}

.af-contacts a {
    word-break: break-word;
}

.af-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.social-tile {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.social-tile svg {
    width: 24px;
    height: 24px;
}

.social-whatsapp { background: #25d366; }
.social-email    { background: #2b2f2d; }

.af-note {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #7d8681;
}

.auth-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-footer-bottom p {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 32px;
    font-size: 13px;
    color: #7d8681;
}

@media (max-width: 960px) {
    .auth-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
    :root { --tile-w: 96px; }

    .poster-grid { gap: 6px; }
    .poster-tile { border-radius: 6px; }

    .auth-topbar { padding: 14px 16px 0; }
    .auth-brand img { height: 26px; }
    .topbar-signup { padding: 8px 14px; font-size: 14px; }

    .auth-container { padding: 20px 16px 32px; align-items: flex-start; }
    .auth-box { padding: 28px 20px 24px; border-radius: 16px; }
    .auth-title { font-size: 26px; }
    .auth-subtitle { margin-bottom: 22px; }
    .divider { margin: 20px 0; }

    .auth-footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 36px 20px 28px;
    }
    .auth-footer-bottom p { padding: 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .poster-grid { animation: none; }
    .poster-tile { transition: none; }
    .social-tile { transition: none; }
}
