:root {
    --primary: #004840;
    --accent: #00ae9b;
    --accent-dark: #008f80;
    --soft: #e7f7f7;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --background: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    background: #f8fbfa;
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 18px;
}

.auth-card {
    width: 100%;
    max-width: 430px;

    padding: 29px 27px 26px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: none;
}

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

.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: var(--primary);
    text-decoration: none;

    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.auth-content {
    width: 100%;
}

.auth-icon {
    width: 72px;
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 22px;

    border-radius: 20px;

    background: linear-gradient(145deg,
            #e7f7f7 0%,
            #f4fcfa 100%);

    color: var(--primary);

    box-shadow:
        0 10px 28px rgba(0, 72, 64, 0.10),
        0 3px 8px rgba(0, 72, 64, 0.04);
}

.auth-icon svg {
    width: 32px;
    height: 32px;
}

.auth-content h1 {
    margin: 0 0 14px;

    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.9px;
    line-height: 1.3;

    color: var(--text);
    text-align: center;
}

.auth-description {
    max-width: 390px;

    margin: 0 auto 26px;

    font-size: 14px;
    line-height: 1.8;

    color: var(--muted);
    text-align: center;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px 16px;
    margin-bottom: 26px;

    border-radius: 10px;

    font-size: 13px;
    line-height: 1.7;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-text {
    flex: 1;
    min-width: 0;
}

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;

    margin-bottom: 10px;

    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;

    top: 50%;
    left: 16px;

    transform: translateY(-50%);

    width: 20px;
    height: 20px;

    color: #64748b;

    pointer-events: none;
}

.input-wrapper input {
    display: block;

    width: 100%;
    height: 54px;

    padding: 0 15px 0 48px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #ffffff;

    color: var(--text);
    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.input-wrapper input:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(0, 174, 155, 0.10);
}

.input-wrapper input[aria-invalid="true"] {
    border-color: #dc2626;
}

.submit-button {
    display: block;

    width: 100%;
    min-height: 54px;

    border: none;
    border-radius: 10px;

    background: var(--primary);
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 7px 18px rgba(0, 72, 64, 0.09);

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.submit-button:hover {
    background: #006057;

    box-shadow:
        0 9px 22px rgba(0, 72, 64, 0.14);
}

.submit-button:active {
    transform: translateY(1px);
}

.submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 11px;
}

.button-spinner {
    width: 19px;
    height: 19px;

    display: inline-block;
    flex-shrink: 0;

    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;

    border-radius: 50%;

    animation: buttonSpin 0.7s linear infinite;
}

.submit-button.is-loading {
    cursor: wait;
    opacity: 0.9;
}

.submit-button.is-loading .button-default {
    display: none;
}

.submit-button.is-loading .button-loading {
    display: inline-flex;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .button-spinner {
        animation-duration: 1.5s;
    }
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin-top: 28px;

    color: var(--primary);
    text-decoration: none;

    font-size: 14px;
    font-weight: 700;
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.back-link:hover {
    color: var(--accent-dark);
}

.reset-success {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 20px 0 12px;

    animation: successFadeIn 0.5s ease-out both;
}

.success-icon-wrapper {
    width: 150px;
    height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 30px;

    border-radius: 50%;

    background: rgba(0, 174, 155, 0.07);

    box-shadow:
        0 0 0 12px rgba(0, 174, 155, 0.035),
        0 14px 35px rgba(0, 72, 64, 0.09);

    animation: successPop 0.65s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.success-icon {
    width: 120px;
    height: 120px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.success-circle {
    fill: var(--accent);

    transform-origin: center;
    transform-box: fill-box;

    animation: successCircleScale 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.success-check {
    fill: none;

    stroke: #ffffff;
    stroke-width: 8;

    stroke-linecap: round;
    stroke-linejoin: round;

    stroke-dasharray: 100;
    stroke-dashoffset: 100;

    animation: drawSuccessCheck 0.55s ease-out 0.5s forwards;
}

.auth-content .success-title {
    margin: 0 0 16px;

    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.3;

    color: var(--text);
}

.success-description {
    max-width: 360px;

    margin: 0 auto 32px;

    font-size: 14px;
    line-height: 1.85;

    color: var(--muted);
}

.success-login-button {
    width: 100%;
    min-height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 14px 20px;

    background: var(--primary);
    color: #ffffff;

    border-radius: 10px;

    font-size: 15px;
    font-weight: 700;
    text-decoration: none;

    box-shadow:
        0 8px 22px rgba(0, 72, 64, 0.12);

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.success-login-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.success-login-button:hover {
    background: #006057;

    box-shadow:
        0 10px 26px rgba(0, 72, 64, 0.17);
}

.success-login-button:active {
    transform: translateY(1px);
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.65);
    }

    70% {
        opacity: 1;
        transform: scale(1.06);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes successCircleScale {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes drawSuccessCheck {
    from {
        stroke-dashoffset: 100;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.auth-footer {
    margin-top: 42px;
    padding-top: 20px;

    border-top: 1px solid var(--border);

    text-align: center;
}

.auth-footer p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.7;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.submit-button:focus-visible,
.back-link:focus-visible,
.brand-link:focus-visible,
.success-login-button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 480px) {

    .auth-page {
        align-items: flex-start;
        padding: 24px 20px;
    }

    .auth-card {
        padding: 25px 19px 23px;
        border-radius: 16px;
    }

    .auth-header {
        margin-bottom: 32px;
    }

    .brand-link {
        font-size: 22px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .auth-icon {
        width: 66px;
        height: 66px;
        margin-bottom: 22px;
    }

    .auth-content h1 {
        font-size: 25px;
    }

    .auth-description {
        font-size: 13px;
        line-height: 1.8;
    }

    .alert {
        font-size: 12px;
    }



    .reset-success {
        padding-top: 24px;
    }

    .success-icon-wrapper {
        width: 132px;
        height: 132px;
        margin-bottom: 26px;
    }

    .success-icon {
        width: 108px;
        height: 108px;
    }

    .auth-content .success-title {
        font-size: 26px;
    }

    .success-description {
        font-size: 13px;
        line-height: 1.8;
    }

    .auth-footer {
        margin-top: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
    }

    .reset-success,
    .success-icon-wrapper,
    .success-circle,
    .success-check {
        animation: none !important;
    }

    .success-circle {
        transform: scale(1);
    }

    .success-check {
        stroke-dashoffset: 0;
    }
}

.success-message {
    width: 100%;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin: 0 0 28px;
    padding: 15px 16px;

    background: #effbf6;
    border: 1px solid #a7e9ce;
    border-radius: 10px;

    color: #285548;
    text-align: left;

    font-size: 13px;
    line-height: 1.7;

    box-shadow: 0 3px 12px rgba(0, 72, 64, 0.025);
}

.success-message .alert-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 1px;

    border-radius: 50%;

    background: #27bd94;
    color: #ffffff;
}

.success-message .alert-icon svg {
    width: 15px;
    height: 15px;
}

.success-message .alert-text {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .success-message {
        font-size: 12px;
        padding: 14px;
    }
}
