:root {
    --primary: #1FA971;
    --primary-dark: #15825A;
    --dark: #0B0F0E;
    --dark2: #111714;
    --dark3: #161D1A;

    /* Light/Dark Variables */
    --bg-body: #0B0F0E;
    --text-main: #E8EDEB;
    --text-sec: #8FA39A;
    --text-dim: #C4D4CE;
    --card-bg: rgba(255, 255, 255, .024);
    --card-border: rgba(255, 255, 255, .08);
    --input-bg: rgba(255, 255, 255, .04);
    --input-border: rgba(255, 255, 255, .12);
    --input-focus-bg: rgba(31, 169, 113, .06);
    --border-color: rgba(31, 169, 113, .22);
    --grain-opacity: 0.5;
    --logo-text: #fff;
    --placeholder-color: #4A6058;
    --divider-color: rgba(255, 255, 255, .08);
    --error-bg: rgba(239, 68, 68, .08);
    --error-border: rgba(239, 68, 68, .2);
}

body.light-mode {
    --bg-body: #F8FAFC;
    --text-main: #1e293b;
    --text-sec: #64748b;
    --text-dim: #334155;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --input-bg: #f8fafc;
    --input-border: #cbd5e1;
    --input-focus-bg: #f0fdf4;
    --border-color: #cbd5e1;
    --grain-opacity: 0.05;
    --logo-text: #1e293b;
    --placeholder-color: #94a3b8;
    --dark: #F8FAFC;
    --divider-color: #e2e8f0;
    --error-bg: #fef2f2;
    --error-border: #fca5a5;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Outfit", sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 5%;
    transition: background 0.3s, color 0.3s;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27300%27 height=%27300%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%270.75%27 numOctaves=%274%27 stitchTiles=%27stitch%27/%3E%3C/filter%3E%3Crect width=%27300%27 height=%27300%27 filter=%27url(%23n)%27 opacity=%270.035%27/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9997;
    opacity: var(--grain-opacity);
}

.bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 20%, rgba(31, 169, 113, .12) 0%, transparent 60%);
    z-index: 0;
}

.bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(31, 169, 113, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 169, 113, .04) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    animation: fadeUp .7s ease both;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(31, 169, 113, .1);
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.6s ease infinite;
}

h1 {
    font-family: "Outfit", sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.04em;
    margin-bottom: 12px;
    color: var(--text-main);
}

h1 .g {
    color: var(--primary);
}

.sub {
    font-size: .96rem;
    color: var(--text-sec);
    line-height: 1.65;
}

.form-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    margin-top: 8px;
}

.form-section {
    margin-bottom: 28px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: .9rem;
    font-family: "Outfit", sans-serif;
    transition: all .25s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(31, 169, 113, .12);
}

input::placeholder {
    color: var(--placeholder-color);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sec);
    font-size: .85rem;
    pointer-events: none;
}

.input-icon input {
    padding-left: 44px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sec);
    cursor: pointer;
    font-size: .9rem;
    transition: color .2s;
    background: none;
    border: none;
    padding: 4px;
}

.password-toggle:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    margin: 0;
    font-size: .88rem;
    font-weight: 400;
    color: var(--text-sec);
    cursor: pointer;
}

.forgot-link {
    font-size: .85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
    color: var(--primary);
}

.btn-wrap {
    text-align: center;
    padding-top: 8px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(31, 169, 113, .32);
    transition: all .3s;
    border: none;
    cursor: pointer;
    font-family: "Outfit", sans-serif;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 0 70px rgba(31, 169, 113, .5);
}

.btn-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-submit i {
    font-size: 1.05rem;
}

.btn-submit .spinner {
    display: none;
}

.btn-submit.loading .btn-text {
    visibility: hidden;
}

.btn-submit.loading .spinner {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-sec);
    font-size: .8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--divider-color);
}

.login-link {
    text-align: center;
    margin-top: 24px;
    font-size: .88rem;
    color: var(--text-sec);
}

.login-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Error styling */
.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-size: .85rem;
    animation: shake 0.4s ease-in-out;
}

.alert-error i {
    font-size: 1rem;
    flex-shrink: 0;
}

.field-validation-error {
    display: block;
    color: #ef4444;
    font-size: .78rem;
    margin-top: 6px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}