:root {
    --primary-color: #2F4550;
    --primary-light: #4a6572;
    --primary-dark: #1f2f39;
    --text-dark: #3d4449;
    --text-light: #7f888f;
    --bg-light: #f5f6f7;
    --border-color: rgba(210, 215, 217, 0.75);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", sans-serif;
    color: var(--text-light);
    line-height: 1.65;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.2;
    background-image:
            radial-gradient(circle, rgba(0,0,0,0.12) 1px, transparent 1px);
    background-size: 20px 20px;
}

body::after {
    content: '';
    position: fixed;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 69, 80, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout ── */
#wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

#main { width: 100%; }

#main > .inner {
    padding: 0;
    margin: 0 auto;
    max-width: 480px;
}

#main > .inner > section {
    padding: 0;
    border-top: none;
}

/* ── Card ── */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
}

.box {
    background: #ffffff;
    border: 1px solid rgba(210, 215, 217, 0.5);
    border-radius: 1rem;
    padding: 2.5rem 2.5rem 2rem;
    box-shadow:
            0 4px 6px rgba(0, 0, 0, 0.04),
            0 20px 50px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateY(20px);
    animation: cardSlideIn 0.6s ease forwards;
    position: relative;
    overflow: hidden;
}

.box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Logo / Back Link ── */
.auth-logo {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
    text-decoration: none;
    border-bottom: none;
}

.auth-logo span {
    font-family: "Roboto Slab", serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.auth-logo:hover span {
    color: var(--primary-color);
}

/* ── Language Switcher ── */
.auth-lang-switcher {
    display: flex;
    justify-content: center;
    margin: 1em 0 0 0;
}

.auth-lang-pill {
    display: flex;
    background: var(--bg-light);
    border-radius: 9999px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-color);
}

.auth-lang-btn {
    padding: 0.35rem 0.85rem;
    font-family: "Roboto Slab", serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    background: transparent;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.auth-lang-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(47, 69, 80, 0.25);
}

.auth-lang-btn:not(.active):hover {
    color: var(--text-dark);
    background: rgba(47, 69, 80, 0.08);
}

/* ── Title ── */
.box h2 {
    font-family: "Roboto Slab", serif;
    font-size: 1.6rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 0.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ── Form ── */
form {
    margin: 0;
}

.form-group {
    margin-bottom: 1.4rem;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    animation: fieldFadeIn 0.4s ease forwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }

@keyframes fieldFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.45rem;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: "Open Sans", sans-serif;
    font-size: 0.92rem;
    color: var(--text-dark);
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 0.6rem;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

input::placeholder {
    color: #b0b5b9;
}

input:hover {
    background: #eef0f2;
}

input:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 69, 80, 0.1);
}

input:focus + .input-focus-line,
input:focus ~ .input-focus-line {
    transform: scaleX(1);
}

/* ── Password Requirements ── */
.password-requirements {
    margin-top: 0.6rem;
    padding: 0.8rem 1rem;
    background: rgba(47, 69, 80, 0.03);
    border-radius: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.5;
}

.password-requirements ul {
    list-style: none;
    padding: 0.3rem 0 0 0;
    margin: 0;
}

.password-requirements li {
    padding: 0.15rem 0 0.15rem 1.4rem;
    position: relative;
}

.password-requirements li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s ease;
}

.password-requirements li.met::before {
    background: #2ecc71;
}

.password-requirements li.met {
    color: #2ecc71;
}

/* ── Messages ── */
.error-message,
.info-message,
.confirmed-message {
    font-size: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 0.6rem;
    text-align: center;
    margin-bottom: 1.2rem;
    display: none;
    opacity: 0;
    transform: translateY(-5px);
    animation: msgSlideIn 0.3s ease forwards;
}

.error-message.visible,
.info-message.visible,
.confirmed-message.visible {
    display: block;
}

@keyframes msgSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.15);
}

.info-message {
    color: #8a7c00;
    background: rgba(138, 140, 0, 0.08);
    border: 1px solid rgba(138, 140, 0, 0.15);
}

.confirmed-message {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.08);
    border: 1px solid rgba(39, 174, 96, 0.15);
}

/* ── Submit Button ── */
.actions {
    margin-top: 1.8rem;
    opacity: 0;
    animation: fieldFadeIn 0.4s ease 0.35s forwards;
}

button[type="submit"],
.button.primary.fit {
    width: 100%;
    padding: 0.85rem 2rem;
    font-family: "Roboto Slab", serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(47, 69, 80, 0.25);
    line-height: 1.5;
    height: auto;
}

button[type="submit"]:hover,
.button.primary.fit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(47, 69, 80, 0.35);
}

button[type="submit"]:active,
.button.primary.fit:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(47, 69, 80, 0.2);
}

/* Ripple effect on button */
button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

button[type="submit"]:active::after {
    width: 400px;
    height: 400px;
}

/* ── Bottom Link ── */
.link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-light);
    opacity: 0;
    animation: fieldFadeIn 0.4s ease 0.4s forwards;
}

.link p {
    margin: 0;
}

.link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.link a:hover {
    border-bottom-color: var(--primary-color);
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 0.78rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Responsive ── */
@media screen and (max-width: 600px) {
    #wrapper {
        align-items: center;
        padding: 2rem 1rem 1rem;
    }

    .box {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 0.8rem;
    }

    .box h2 {
        font-size: 1.35rem;
    }

    .auth-logo span {
        font-size: 1.2rem;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        padding: 0.7rem 0.85rem;
        font-size: 0.88rem;
    }

    button[type="submit"],
    .button.primary.fit {
        padding: 0.8rem 1.5rem;
        font-size: 0.82rem;
    }
}

@media screen and (max-width: 380px) {
    .box {
        padding: 1.5rem 1.2rem 1.2rem;
    }

    .box h2 {
        font-size: 1.2rem;
    }

    .form-group {
        margin-bottom: 1.1rem;
    }
}

/* ── Utility: hide unused wrapper styles from main.css ── */
#sidebar { display: none !important; }