:root {
    --auth-bg: #f4f7fb;
    --auth-surface: #ffffff;
    --auth-border: #dfe6ee;
    --auth-text: #1f2d3d;
    --auth-muted: #6a7a8c;
    /* Brand teal sampled from the Book Palace logo. */
    --auth-accent: #089da1;
    --auth-accent-dark: #066f73;
    --auth-soft: #e8f7f7;
    --auth-warm: #06777b;
    --auth-shadow: 0 24px 50px rgba(24, 39, 75, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(8, 157, 161, 0.10), transparent 26%),
        radial-gradient(circle at bottom right, rgba(201, 107, 74, 0.10), transparent 24%),
        var(--auth-bg);
}

.auth-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--auth-shadow);
}

.auth-shell--login {
    min-height: 620px;
}

.auth-shell--register {
    min-height: 720px;
}

.auth-panel {
    padding: 42px;
}

.auth-panel--intro {
    background:
        linear-gradient(160deg, rgba(13, 29, 45, 0.88), rgba(8, 157, 161, 0.78)),
        url("../Photos/books.jpeg") center/cover no-repeat;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
}

.auth-badge {
    width: fit-content;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.10);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-panel--intro h1 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 1.05;
    font-weight: 800;
}

.auth-panel--intro p {
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.9;
    font-size: 1rem;
}

.auth-feature-list {
    display: grid;
    gap: 14px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
}

.auth-feature-item .auth-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
}

.auth-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-panel--form {
    background: #fff;
}

.auth-topbar {
    margin-bottom: 24px;
}

.auth-backlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 600;
}

.auth-backlink:hover {
    color: var(--auth-text);
}

.auth-form-header {
    margin-bottom: 26px;
}

.auth-form-header h2 {
    font-size: 2rem;
    color: var(--auth-text);
    margin-bottom: 8px;
    font-weight: 800;
}

.auth-form-header p {
    color: var(--auth-muted);
    line-height: 1.8;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form--register {
    gap: 16px;
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field > span {
    color: var(--auth-text);
    font-size: 0.93rem;
    font-weight: 700;
}

.auth-input {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus-within {
    border-color: rgba(8, 157, 161, 0.55);
    box-shadow: 0 0 0 4px rgba(8, 157, 161, 0.12);
}

.auth-input .auth-icon {
    color: #7a8798;
    font-size: 0.98rem;
}

.auth-input input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--auth-text);
    font-size: 0.96rem;
}

.auth-submit {
    margin-top: 6px;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--auth-accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.auth-submit:hover {
    background: var(--auth-accent-dark);
    transform: translateY(-1px);
}

.auth-helper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--auth-muted);
    font-size: 0.94rem;
}

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

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

.auth-error {
    color: #cf4d3c;
    font-size: 0.8rem;
    line-height: 1.5;
}

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

    .auth-panel {
        padding: 28px 22px;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .auth-body {
        padding: 16px;
    }

    .auth-form-header h2 {
        font-size: 1.7rem;
    }

    .auth-panel--intro h1 {
        font-size: 2rem;
    }
}
