@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600&display=swap");

:root {
    --color-primary: #1f4f8a;
    --color-border: #142336;
    --color-bg: #060c14;
    --color-card: #0a1220;
    --color-text: #e5eef9;
    --color-muted: #7f93ad;
    --color-input: #07101b;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 50% 0%, #111a27 0%, #060c14 60%, #050a12 100%);
    color: var(--color-text);
}

.page {
    width: min(760px, 92vw);
}

.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 18px 60px rgba(3, 10, 20, 0.55);
    animation: rise 0.45s ease;
}

.auth-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.auth-header h1 {
    font-family: "Space Grotesk", Inter, system-ui, sans-serif;
    letter-spacing: 0.2px;
    margin: 0 0 6px;
}

.auth-header p {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
}

.auth-header .icon {
    height: 46px;
    width: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(31, 79, 138, 0.15);
    border: 1px solid rgba(31, 79, 138, 0.4);
}

.auth-header .icon i {
    font-size: 20px;
}

.auth-card {
    display: grid;
    gap: 18px;
}

.section {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: rgba(7, 16, 27, 0.6);
    animation: fadeUp 0.45s ease both;
}

.section:nth-of-type(1) { animation-delay: 0.05s; }
.section:nth-of-type(2) { animation-delay: 0.12s; }

.section-title {
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: 12px;
}

label span {
    color: var(--color-muted);
}

label .error {
    display: none;
    color: #f6c3cf;
    font-size: 11px;
}

input {
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-input);
    color: var(--color-text);
    padding: 0 12px;
    font-size: 15px;
}

input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.18rem rgba(31, 79, 138, 0.22);
    outline: none;
}

.submitted input:invalid {
    border-color: rgba(138, 31, 64, 0.7);
    box-shadow: 0 0 0 0.18rem rgba(138, 31, 64, 0.18);
}

.submitted input:invalid + .error {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.password-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.password-row label {
    margin-bottom: 0;
}

.password-row .grow {
    flex: 1;
}

.toggle {
    height: 44px;
    width: 44px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    display: grid;
    place-items: center;
    margin-left: auto;
    flex: 0 0 44px;
    margin-bottom: 2px;
}

.eye-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.eye-icon .eye-slash {
    opacity: 1;
}

.toggle.is-active .eye-slash {
    opacity: 0;
}

.strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.strength-bar {
    height: 6px;
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.strength-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 0%;
    background: #f6c3cf;
    transition: width 0.2s ease, background 0.2s ease;
}

.strength.weak .strength-bar::after { width: 25%; background: #f6c3cf; }
.strength.medium .strength-bar::after { width: 55%; background: #f6d68a; }
.strength.strong .strength-bar::after { width: 85%; background: #bff2d6; }

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.primary {
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    padding: 0 16px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(31, 79, 138, 0.25);
}

.ghost {
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    padding: 0 16px;
    text-decoration: none;
    display: grid;
    place-items: center;
}

.invite-banner {
    background: rgba(31, 79, 138, 0.12);
    border: 1px solid rgba(31, 79, 138, 0.4);
    color: var(--color-text);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invite-label {
    color: var(--color-muted);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--color-input) inset;
    -webkit-text-fill-color: var(--color-text);
    caret-color: var(--color-text);
    transition: background-color 9999s ease-in-out 0s;
}
