# YOUR FOURTH MINI PROJECT — Password Validator
# Every requirement is a condition. Every condition is a bool.

# ─────────────────────────────────────────────
# PART 1 — Basic validation
# ─────────────────────────────────────────────

# TODO: Ask the user for a password
password = ...

# TODO: Check if the password is at least 8 characters long
long_enough = ...

# TODO: Check if the password has at least one uppercase letter
# Hint: if the password has no uppercase, lowercasing it changes nothing
has_upper = ...

# TODO: Check if the password contains at least one number
# Hint: use "in" to check if any digit is in the password
has_number = (
    "0" in password or "1" in password or "2" in password or
    "3" in password or "4" in password or "5" in password or
    "6" in password or "7" in password or "8" in password or
    "9" in password
)

# TODO: Check if the password contains no spaces
no_spaces = ...

# TODO: Combine all conditions with and
is_valid = ...

# TODO: Print each condition and the final result
# Expected output (for "RedHorn7"):
# Long enough: True
# Has uppercase: True
# Has number: True
# No spaces: True
# Password valid: True
print(f"Long enough: {long_enough}")
print(f"Has uppercase: {has_upper}")
print(f"Has number: {has_number}")
print(f"No spaces: {no_spaces}")
print(f"Password valid: {is_valid}")

# ─────────────────────────────────────────────
# PART 2 — Military grade
# ─────────────────────────────────────────────

# TODO: Add two more requirements:
# - At least 12 characters long
# - Contains at least one special character (!, @, #, $, %)
# Hint: use "in" to check each special character with or

password = input("Enter your military-grade password: ")

long_enough = ...
has_upper = ...
has_number = ...
no_spaces = ...
has_special = ...

is_valid = ...

print(f"Password valid: {is_valid}")

# ─────────────────────────────────────────────
# PART 3 — Going further (optional)
# ─────────────────────────────────────────────

# TODO: Connect it to the username generator from the Strings chapter
# Ask for a username and a password
# Validate both — username must be at least 4 characters
# Print a summary:
# "Username: bull01 | Password valid: True | Access granted: True"

username = input("Enter your username: ")
password = input("Enter your password: ")

username_valid = ...
password_valid = ...
access_granted = ...

print(f"Username: {username} | Password valid: {password_valid} | Access granted: {access_granted}")
