form {
    display: flex;
    flex-direction: column;
    gap: 1.25em;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;

    h1 {
        font-size: 2.5em;
        margin-bottom: 0.5em;
        text-align: center;
        color: var(--text-color);
    }

    .alert {
        padding: 1em;
        border-radius: 12px;
        margin-bottom: 1em;
        font-size: 0.9em;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .alert-success {
        background-color: rgba(40, 167, 69, 0.1);
        color: #28a745;
        border: 1px solid rgba(40, 167, 69, 0.2);
    }

    .alert-error {
        background-color: rgba(220, 53, 69, 0.1);
        color: #dc3545;
        border: 1px solid rgba(220, 53, 69, 0.2);
    }

    .form-description {
        color: var(--text-color);
        opacity: 0.8;
        font-size: 0.95em;
        line-height: 1.6;
        text-align: center;
        margin-bottom: 0.5em;
    }

    .form-description strong {
        color: var(--primary-color);
    }
}

.input-group {
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 0.5em;

    label {
        color: var(--primary-color);
        font-size: 1.2em;
    }

    input,
    select {
        width: 100%;
        padding: 1em 1.2em;
        border-radius: 12px;
        border: 1px solid rgba(136, 136, 136, 0.2);

        background-color: #fff;
        color: #333;

        font-size: 1em;
        box-sizing: border-box;
        transition: all 0.3s ease;
        outline: none;

        &:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
        }
    }

    select {
        appearance: none;
        background-repeat: no-repeat;
        background-position: right 1em top 50%;
        background-size: 0.65em auto;
        cursor: pointer;
    }
}

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

.password-wrapper input {
    padding-right: 3em;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;

    color: #333;

    opacity: 0.5;
    transition: opacity 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
        opacity: 1;
    }
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-color);
    gap: 1em;
    flex-wrap: wrap;
}

@media (max-width: 370px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8em;
    }
}


.legal-agreements {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-top: 0.5em;

    .checkbox {
        font-size: 0.85em;
        line-height: 1.4;
        align-items: center;
        color: var(--text-color);
        opacity: 0.9;
        flex-wrap: wrap;
    }

    a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 600;

        &:hover {
            text-decoration: underline;
        }
    }
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75em;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    transition: color 0.2s ease;

    &:hover {
        color: var(--primary-color);
    }

    input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 1.25em;
        height: 1.25em;
        border: 2px solid rgba(136, 136, 136, 0.3);
        border-radius: 6px;
        background: transparent;
        cursor: pointer;
        position: relative;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
        display: grid;
        place-content: center;

        &::before {
            content: "";
            width: 0.65em;
            height: 0.65em;
            clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
            transform: scale(0);
            transform-origin: center;
            transition: 120ms transform ease-in-out;
            background-color: white;
        }

        &:checked {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
        }

        &:checked::before {
            transform: scale(1);
        }

        &:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

        &:hover {
            border-color: var(--primary-color);
        }
    }
}

.forgot-link {
    color: var(--text-color);
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.2s, color 0.2s;

    &:hover {
        opacity: 1;
        color: var(--primary-color);
        text-decoration: underline;
    }
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    padding: 1em;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 38, 177, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

    &:active {
        transform: translateY(0);
    }
}

.verification-resend {
    display: flex;
    align-items: center;
    gap: 0.45em;
    margin-top: -0.15em;
    margin-bottom: 0.1em;
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.85;
    flex-wrap: wrap;
}

.resend-link {
    border: none;
    background: transparent;
    color: var(--primary-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.resend-link:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.resend-feedback {
    margin: 0;
    width: 100%;
    font-size: 0.85em;
}

.resend-feedback.success {
    color: #28a745;
}

.resend-feedback.error {
    color: #dc3545;
}

.register-link {
    text-align: center;
    font-size: 0.95em;
    color: var(--text-color);
    margin-top: 1em;

    a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 600;
        transition: all ease-in-out 0.2s;

        &:hover {
            opacity: 0.8;
        }
    }
}

.required-star {
    color: red;
    margin-left: 2px;
}

.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    padding: 0.75em 1em;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 123, 255, 0.1);
    margin-top: 0.5em;
    font-size: 0.85em;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-requirements.visible {
    opacity: 1;
    max-height: 200px;
    padding: 0.75em 1em;
}

.password-requirements .req-title {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.25em;
    font-size: 0.9em;
}

.password-requirements .req-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.password-requirements .req-item.valid {
    opacity: 1;
    color: #28a745;
}

.password-requirements .req-item::before {
    content: "○";
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.password-requirements .req-item.valid::before {
    content: "✓";
    font-weight: bold;
}

.password-strength {
    height: 4px;
    background: rgba(136, 136, 136, 0.2);
    border-radius: 2px;
    margin-top: 0.5em;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength-bar.weak {
    width: 25%;
    background: #dc3545;
}

.password-strength-bar.fair {
    width: 50%;
    background: #ffc107;
}

.password-strength-bar.good {
    width: 75%;
    background: #17a2b8;
}

.password-strength-bar.strong {
    width: 100%;
    background: #28a745;
}
