:root {
    --primary-color: #004d00;
    --primary-hover: #003300;
    /* Revert to Radial Gradient as requested, but keeping noise overlay for smoothing */
    --bg-gradient-dark: radial-gradient(circle at center, #001a0d 0%, #000000 120%);

    --glass-bg-dark: rgba(20, 20, 20, 0.90);
    --font-stack: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Global Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-gradient-dark);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content like in Login page */
    align-items: center;
    min-height: 100vh;
    color: #eee;
    position: relative; /* Context for noise overlay */
}

/* Noise Overlay to reduce banding */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-size: 100px 100px;
}



.center-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1;
}

/* Ensure Logo is distinct and centered above form */
.logo-container {
    margin-bottom: 20px; /* Reduced from 30px to match Login page */
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
}

.logo-large {
    width: 400px; /* Exact match to Login page */
    max-width: 100%;
    max-height: 150px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
    object-fit: contain;
}

.form-container {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 16px;
    background-color: var(--glass-bg-dark); /* Use dark mode background */
    backdrop-filter: blur(12px);
    border-color: rgba(255,255,255,0.1); /* Use dark mode border */
    box-shadow: 0 4px 20px rgba(0,0,0,0.5); /* Use dark mode shadow */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0 auto; /* Ensure horizontal centering */
}

.form-container h2 {
    margin: 0;
    padding: 0;
    border-bottom: none;
    padding-bottom: 0;
}



.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
    width: 100%;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: inherit;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #555; /* Dark mode border */
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.3); /* Dark mode background */
    color: white; /* Dark mode text color */
}

input[type="color"] {
    height: 50px;
    padding: 2px;
    cursor: pointer;
}



.dark-mode .input-group input:focus {
    border-color: #008000;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.2);
    outline: none;
}

/* Button Styles */
.btn, input[type="submit"] {
    background: var(--primary-color);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    display: block;
    box-sizing: border-box;
    text-align: center;
    margin-top: 10px;
}

.btn:hover, input[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.back-btn {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px; /* Slightly smaller padding */
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    width: auto;
    margin: 0; /* Remove top margin */
}

.header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    width: 100%; /* Ensure full width */
}
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 40px;
}

.refresh-password-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    opacity: 0.6;
}

/* Requirements List */
.password-requirements {
    list-style: none;
    padding: 10px;
    margin-top: 5px;
    font-size: 0.85rem;
    text-align: left;
    background: rgba(255,255,255,0.05); /* Dark mode background */
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}



.password-requirements li { margin-bottom: 5px; }



/* Messages */
.message { color: #0f5132; background-color: #d1e7dd; padding: 12px; border-radius: 8px; margin-bottom: 20px; width: 100%; box-sizing: border-box; }
.error { color: #842029; background-color: #f8d7da; padding: 12px; border-radius: 8px; margin-bottom: 20px; width: 100%; box-sizing: border-box; }

footer {
    position: static;
    width: 100%;
    text-align: center;
    font-size: 12px;
    opacity: 0.6;
    margin: 0; /* Add margin */
    padding: 0;
    z-index: 100;
}

/* Green Glow Focus State */
.dark-mode .input-group input:focus {
    border-color: #008000;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.2);
    outline: none;
}

/* Mobile Responsiveness */
@media only screen and (max-width: 600px) {
    body {
        padding: 20px 0;
        justify-content: flex-start; /* Prevent clipping at top */
    }
    
    .center-container {
        padding: 10px;
        width: 100%; /* Ensure full width for centering */
        text-align: center; /* Fallback for older browsers for logo centering */
    }
    
    .logo-container {
        margin-bottom: 10px; /* Reduced further on mobile */
        width: 100%; /* Ensure full width */
        display: block; /* Force block to allow text-align centering of children */
        text-align: center; /* Center img if display block */
    }
    
    .logo-large {
        width: 80%; /* Match Login page mobile width */
        max-width: 250px;
        margin: 0 auto; /* Explicit auto margins for block-level centering */
        display: block; /* Ensure it is block-level for margin auto */
    }
    
    .form-container {
        padding: 30px 20px;
        width: 100%;
        max-width: none;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .register-btn, .login-btn {
        width: 100%;
    }
}
