:root {
    --auth-text: #10202a;
    --auth-muted: #62717f;
    --auth-panel: rgba(255, 255, 255, 0.96);
    --auth-line: #d8e3ec;
    --auth-primary: #0f766e;
    --auth-primary-dark: #115e59;
    --auth-danger: #b42318;
    --auth-danger-bg: #fff1f0;
    --auth-success: #15803d;
    --auth-success-bg: #ecfdf3;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    color: var(--auth-text);
    font-family: Arial, Helvetica, sans-serif;
    background:
        linear-gradient(135deg, rgba(9, 30, 39, 0.82), rgba(15, 118, 110, 0.48)),
        url("../img/backgrounds/login-bg.jpg") center / cover no-repeat,
        #10202a;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 26%),
        rgba(8, 20, 26, 0.42);
    pointer-events: none;
}

.auth-card {
    position: relative;
    width: min(460px, 100%);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    background: var(--auth-panel);
    box-shadow: 0 28px 80px rgba(8, 20, 26, 0.36);
    backdrop-filter: blur(18px);
}

.auth-card-wide {
    width: min(680px, 100%);
}

.auth-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.auth-logo-img {
    display: block;
    width: min(380px, 90%);
    max-width: 380px;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    margin: 0 auto 28px;
}

.auth-logo span {
    display: block;
    color: var(--auth-primary-dark);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 auto 18px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
    padding: 5px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: #f6faf9;
}

.auth-tabs a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--auth-muted);
    font-weight: 800;
    text-decoration: none;
}

.auth-tabs a.active,
.auth-tabs a:hover,
.auth-tabs a:focus {
    color: #ffffff;
    background: var(--auth-primary);
    outline: none;
}

.auth-header {
    margin-bottom: 22px;
    text-align: center;
}

.auth-header h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: 0;
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field-wide {
    grid-column: 1 / -1;
}

.auth-field label {
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 900;
}

.auth-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    padding: 11px 13px;
    background: #ffffff;
    color: var(--auth-text);
    font: inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.password-wrapper {
    position: relative;
}

.password-wrapper .auth-input {
    padding-right: 76px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-width: 54px;
    min-height: 34px;
    border: 0;
    border-radius: 9px;
    background: #e8f3f1;
    color: var(--auth-primary-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus {
    background: var(--auth-primary);
    color: #ffffff;
    outline: none;
}

.auth-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(15, 118, 110, 0.28);
}

.auth-button:hover,
.auth-button:focus {
    filter: brightness(0.96);
    outline: 4px solid rgba(15, 118, 110, 0.16);
}

.auth-error,
.auth-success {
    margin-bottom: 18px;
    border-radius: 12px;
    padding: 13px 15px;
    line-height: 1.45;
}

.auth-error {
    border: 1px solid rgba(180, 35, 24, 0.22);
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
}

.auth-success {
    border: 1px solid rgba(21, 128, 61, 0.22);
    background: var(--auth-success-bg);
    color: var(--auth-success);
}

.auth-error ul {
    margin: 0;
    padding-left: 18px;
}

.auth-error li + li {
    margin-top: 6px;
}

.email-match,
.email-mismatch {
    min-height: 18px;
    font-size: 12px;
    font-weight: 900;
}

.email-match {
    color: var(--auth-success);
}

.email-mismatch {
    color: var(--auth-danger);
}

.auth-links {
    margin-top: 22px;
    text-align: center;
}

.auth-links a {
    color: var(--auth-primary-dark);
    font-weight: 900;
    text-decoration: none;
}

.auth-links a:hover,
.auth-links a:focus {
    text-decoration: underline;
    outline: none;
}

@media (max-width: 680px) {
    body.auth-page {
        padding: 18px;
    }

    .auth-card {
        padding: 24px;
        border-radius: 16px;
    }

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

    .auth-header h1 {
        font-size: 26px;
    }
}
