:root {
    --background: #FCFAFD;
    --white: #FFFFFF;
    --primary: #8955D3;
    --dark-purple: #6840B0;
    --light-purple: #F0E7FC;
    --pink: #ED6398;
    --blue: #539CD8;
    --text: #211C35;
    --muted: #827D90;
    --border: #ECE7F1;
    --danger: #D94B60;
    --success: #42A77A;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -1.3px;
    color: var(--dark-purple);
}

.brand-heart {
    color: var(--pink);
    font-size: 25px;
}

.auth-card {
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 12px 45px rgba(104, 64, 176, 0.06);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 25px 18px;
    background: var(--light-purple);
    border-radius: 21px;
    text-align: center;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 145px;
    height: 145px;
    right: -65px;
    top: -65px;
    background: #E6D6FA;
}

.hero::after {
    width: 120px;
    height: 120px;
    left: -60px;
    bottom: -65px;
    background: #F9DDEC;
}

.hero-label {
    position: relative;
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--dark-purple);
}

.hero-icon {
    position: relative;
    width: 68px;
    height: 68px;
    margin: 17px auto;
    display: grid;
    place-items: center;
    background: white;
    border-radius: 22px;
    font-size: 32px;
    transform: rotate(-5deg);
}

.hero h1 {
    position: relative;
    margin: 0 0 9px;
    font-size: 25px;
    letter-spacing: -0.8px;
}

.hero p {
    position: relative;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #74648D;
}

.account-info {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--background);
}

.account-info span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
}

.account-info strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

form {
    margin-top: 22px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 75px 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

input::placeholder {
    color: var(--muted);
    font-size: 13px;
}

.visibility-button {
    position: absolute;
    right: 10px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--dark-purple);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.strength-bars {
    display: flex;
    gap: 5px;
    margin-top: 12px;
}

.strength-bars span {
    flex: 1;
    height: 4px;
    border-radius: 10px;
    background: var(--border);
    transition: background 0.2s;
}

.field-hint {
    margin: 7px 0 20px;
    font-size: 11px;
    color: var(--muted);
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 20px;
    padding: 12px;
    border: none;
    border-radius: 15px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-button:hover {
    background: var(--dark-purple);
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
}

.message p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.error {
    background: #FFEDF0;
    color: #B83D50;
}

.error strong {
    font-size: 14px;
}

.success {
    background: #E7F6EE;
    color: #287A56;
    text-align: center;
}

.success h2 {
    font-size: 19px;
    margin: 10px 0;
}

.success-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto;
    border-radius: 50%;
    background: white;
    color: var(--success);
    font-size: 30px;
    font-weight: bold;
}

.loading {
    padding: 30px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 14px;
    border: 3px solid var(--light-purple);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.security-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 12px;
    border-radius: 13px;
    background: #EAF3FC;
}

.security-note span {
    font-size: 21px;
}

.security-note p {
    margin: 0;
    color: #6285A4;
    font-size: 11px;
    line-height: 1.6;
}

footer {
    margin-top: 23px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
}

footer span {
    color: var(--pink);
}

@media (max-width: 380px) {
    body {
        padding: 15px 12px;
    }

    .auth-card {
        padding: 15px;
    }

    .hero h1 {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition: none !important;
    }
}