:root {
    --eg-dark: #11111c;
    --eg-panel: #ffffff;
    --eg-bg: #eef3f8;
    --eg-text: #111827;
    --eg-muted: #64748b;
    --eg-edge: #dbe3ee;
    --eg-purple: #7c5cff;
    --eg-purple-dark: #5b45d8;
    --eg-success-bg: #dcfce7;
    --eg-success: #166534;
    --eg-error-bg: #fee2e2;
    --eg-error: #991b1b;
}

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

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    font-family: Arial, sans-serif;
    background:
        linear-gradient(180deg, rgba(17, 17, 28, 0.96) 0, rgba(17, 17, 28, 0.96) 112px, transparent 112px),
        var(--eg-bg);
    color: var(--eg-text);
    overflow-x: hidden;
}

.auth-shell {
    width: min(92vw, 540px);
    background: var(--eg-panel);
    border: 1px solid var(--eg-edge);
    border-radius: 12px;
    box-shadow: 0 22px 55px rgba(17, 24, 39, 0.18);
    overflow: hidden;
}

.auth-shell::before {
    content: "";
    display: block;
    height: 7px;
    background: linear-gradient(90deg, #667eea, var(--eg-purple), #10b981);
}

.auth-logo {
    display: block;
    width: 145px;
    margin: 26px auto 18px;
}

.auth-shell h1,
.auth-shell p,
.auth-form,
.auth-message,
.auth-help {
    margin-left: 34px;
    margin-right: 34px;
}

.auth-shell h1 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--eg-text);
    font-size: 28px;
    line-height: 1.18;
    letter-spacing: 0;
}

.auth-shell p {
    color: var(--eg-muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    margin-bottom: 18px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: #253044;
    font-size: 14px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 15px;
    color: var(--eg-text);
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--eg-purple);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16);
}

.auth-form button,
.auth-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--eg-purple), var(--eg-purple-dark));
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(91, 69, 216, 0.22);
}

.auth-form button:hover,
.auth-link-button:hover {
    filter: brightness(1.04);
}

.auth-message {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    margin-top: 16px;
}

.auth-message.error {
    background: var(--eg-error-bg);
    color: var(--eg-error);
}

.auth-message.success {
    background: var(--eg-success-bg);
    color: var(--eg-success);
}

.auth-help {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 13px;
}

.auth-shell > p:last-child {
    margin-bottom: 30px;
}

@media (max-height: 700px) and (min-width: 720px) {
    body {
        align-items: start;
        padding-top: 22px;
        overflow-y: auto;
    }

    .auth-logo {
        margin-top: 18px;
        margin-bottom: 12px;
    }

    .auth-shell h1,
    .auth-shell p,
    .auth-form,
    .auth-message,
    .auth-help {
        margin-left: 28px;
        margin-right: 28px;
    }
}

@media (max-width: 560px) {
    body {
        padding: 14px;
        align-items: start;
        overflow-y: auto;
    }

    .auth-shell {
        width: 100%;
    }

    .auth-shell h1,
    .auth-shell p,
    .auth-form,
    .auth-message,
    .auth-help {
        margin-left: 22px;
        margin-right: 22px;
    }

    .auth-shell h1 {
        font-size: 24px;
    }
}
