/* Bethel Oasis of Love Church: login and register
   Fonts (Fraunces + Lato) are loaded with <link> tags in the HTML heads. */

:root {
    --teal-900: #082b38;
    --teal-700: #0f5168;
    --teal-500: #14607a;
    --aqua: #7fd1d9;
    --gold: #e3b04b;
    --paper: #f1f6f7;
    --line: #c4d4d9;
    --field-line: #8fa9b1;
    --ink: #0b2a35;
    --muted: #4a626c;
    --danger: #a31f14;
    --danger-bg: #fdeceb;
    --ok: #0b6b4d;
    --ok-bg: #e4f5ee;
    --radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Lato", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
}

a {
    color: var(--teal-500);
    font-weight: 700;
}

a:hover {
    color: var(--teal-900);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- Page layout ---------- */

.auth {
    display: grid;
    grid-template-columns: minmax(340px, 5fr) 7fr;
    min-height: 100vh;
}

/* ---------- Left: welcome panel ---------- */

.welcome {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px 120px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(127, 209, 217, 0.22), transparent 60%),
        linear-gradient(170deg, var(--teal-700) 0%, var(--teal-900) 75%);
}

/* Layered dunes / water lines along the bottom edge */
.welcome::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 90 C100 50 200 130 300 90 S500 50 600 90 V200 H0Z' fill='%23ffffff' fill-opacity='.05'/%3E%3Cpath d='M0 125 C120 85 220 165 320 125 S520 95 600 125 V200 H0Z' fill='%23ffffff' fill-opacity='.07'/%3E%3Cpath d='M0 160 C100 130 220 190 340 160 S520 140 600 160 V200 H0Z' fill='%23e3b04b' fill-opacity='.22'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
    pointer-events: none;
}

.welcome > * {
    position: relative;
    z-index: 1;
}

/* The ripple medallion: the one memorable element */
.medallion {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    padding: 4px;
    background: #fff;
    box-shadow:
        0 0 0 12px rgba(255, 255, 255, 0.10),
        0 0 0 26px rgba(255, 255, 255, 0.06),
        0 0 0 42px rgba(255, 255, 255, 0.03);
    animation: ripple 1.4s ease-out both;
}

.medallion img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes ripple {
    from {
        box-shadow:
            0 0 0 0 rgba(255, 255, 255, 0),
            0 0 0 0 rgba(255, 255, 255, 0),
            0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.welcome h1 {
    margin-top: 64px;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    max-width: 14ch;
}

.welcome h2 {
    margin-top: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
}

.welcome p {
    margin-top: 10px;
    max-width: 34ch;
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Right: form panel ---------- */

.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 24px 48px;
}

.back {
    align-self: center;
    width: 100%;
    max-width: 560px;
    font-size: 0.95rem;
}

.back a {
    text-decoration: none;
}

.back a:hover {
    text-decoration: underline;
}

.card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px 36px 32px;
    box-shadow: 0 12px 32px -16px rgba(8, 43, 56, 0.35);
}

.card--narrow {
    max-width: 440px;
}

.card-logo {
    display: none;
}

.card h1 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: 1.85rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--teal-900);
}

.card .lead {
    margin-top: 6px;
    color: var(--muted);
}

form {
    margin-top: 24px;
    display: grid;
    gap: 18px;
}

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.alert i {
    margin-top: 3px;
}

.alert--error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #f1c3bf;
}

.alert--ok {
    color: var(--ok);
    background: var(--ok-bg);
    border: 1px solid #b6e1d1;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

.field-error {
    margin-top: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--danger);
}

/* ---------- Fields ---------- */

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

.field label,
.field legend {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--teal-900);
}

fieldset {
    border: 0;
    min-width: 0;
}

.control {
    position: relative;
}

.control .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--teal-500);
    pointer-events: none;
}

.control input,
.control select {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.control input::placeholder {
    color: #6d838c;
}

.control input:hover,
.control select:hover {
    border-color: var(--teal-500);
}

.control input:focus,
.control select:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 96, 122, 0.25);
}

.control select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2314607a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
}

/* Password show / hide */
.control--password input {
    padding-right: 48px;
}

.toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.toggle:hover {
    color: var(--teal-900);
    background: var(--paper);
}

/* Gender choice */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.choice {
    position: relative;
}

.choice input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.choice span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    font-weight: 700;
    color: var(--muted);
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.choice:hover span {
    border-color: var(--teal-500);
}

.choice input:checked + span {
    background: var(--teal-700);
    border-color: var(--teal-700);
    color: #fff;
}

.choice input:focus-visible + span {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Profile photo */
.upload {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1.5px dashed var(--field-line);
    border-radius: 10px;
    background: #fafcfc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.upload:hover {
    border-color: var(--teal-500);
    background: #f3f9fa;
}

.upload:focus-within {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.avatar {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--teal-500);
    background: #e3eff2;
    font-size: 1.25rem;
}

.avatar img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload.has-photo .avatar img {
    display: block;
}

.upload.has-photo .avatar i {
    display: none;
}

.upload strong {
    display: block;
    color: var(--teal-900);
}

.upload small {
    color: var(--muted);
}

/* ---------- Buttons and footer ---------- */

.btn {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: var(--teal-700);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn:hover {
    background: var(--teal-900);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.switch {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
}

/* ---------- Tablet and phone ---------- */

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

    .welcome {
        position: static;
        height: auto;
        padding: 32px 24px 84px;
    }

    .welcome::after {
        height: 60px;
    }

    .medallion {
        width: 68px;
        height: 68px;
        box-shadow:
            0 0 0 8px rgba(255, 255, 255, 0.10),
            0 0 0 17px rgba(255, 255, 255, 0.06);
    }

    .welcome h1 {
        margin-top: 36px;
        font-size: 1.5rem;
        max-width: none;
    }

    .welcome h2 {
        margin-top: 8px;
        font-size: 1rem;
    }

    .welcome p {
        display: none;
    }

    .panel {
        padding: 0 16px 40px;
        gap: 14px;
        margin-top: -44px;
        position: relative;
        z-index: 2;
    }

    .back {
        display: none;
    }

    .card {
        padding: 28px 22px 26px;
    }
}

@media (max-width: 520px) {
    .row {
        grid-template-columns: 1fr;
    }

    .card h1 {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .medallion {
        animation: none;
    }

    * {
        transition: none !important;
    }
}
