/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* --- CSS Variables (Root) --- */
:root {
    --bg-dark: #0B0E11;
    --bg-input: #161B22;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-placeholder: #6E7681;
    --accent-blue: #388BFD;
    --border-color: #30363D;
    --button-bg: #21262D;
    --button-hover-bg: #30363D;
    --danger-text: #f85149;
}

/* --- Global & Body Styles --- */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Auth Wrapper Layout --- */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    width: 100%;
    flex-shrink: 0;
}

.auth-header .logo {
    max-height: 30px;
    width: auto;
}

.header-nav a {
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9em;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-nav a:hover {
    background-color: var(--bg-input);
    border-color: var(--text-secondary);
}

.auth-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* --- Form Container & Typography --- */
.form-container {
    width: 100%;
    max-width: 420px;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- UNIFIED FORM ELEMENT STYLES --- */
.input-group {
    position: relative;
}

/* Base styles shared by both text inputs and select dropdowns */
.form-control,
.form-select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Specific styles for the <select> element to add a custom arrow */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238B949E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem; /* Make space for the arrow */
}

/* Shared focus style for both elements */
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.3);
}

/* Placeholder style for text inputs */
.form-control::placeholder {
    color: var(--text-placeholder);
}

/* Style for the first disabled option in a select, to act like a placeholder */
.form-select:invalid,
.form-select option[value=""] {
    color: var(--text-placeholder);
}
.form-select option {
    color: var(--text-primary);
    background-color: var(--bg-input); /* For dropdown list background */
}

/* --- Form Components --- */
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
}

/* For Login page */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    accent-color: var(--accent-blue);
}

/* For Register page reCAPTCHA */
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* --- Buttons & Links --- */
.auth-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9em;
}

.auth-link:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    background-color: var(--button-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--text-secondary);
}

.bottom-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.bottom-text .auth-link {
    font-size: 1em; /* Make the link slightly larger than surrounding text */
    font-weight: 500;
}


/* --- PHP Error Message Styling --- */
.error {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(248, 81, 73, 0.5);
    background-color: rgba(248, 81, 73, 0.1);
    color: var(--danger-text);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9em;
    list-style-position: inside;
}

/* --- Responsive Adjustments --- */
@media (max-width: 576px) {
    .auth-header {
        padding: 1.5rem;
    }
}
/* --- BUTTON VARIANTS --- */

/* Danger Button Style (e.g., for Logout) */
.btn-danger {
    width: 100%;
    background-color: rgba(248, 81, 73, 0.15); /* Red transparent background */
    border: 1px solid rgba(248, 81, 73, 0.5);
    color: var(--danger-text);
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none; /* For when using on <a> tags */
    display: inline-block; /* For when using on <a> tags */
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-danger:hover {
    background-color: rgba(248, 81, 73, 0.3);
    border-color: var(--danger-text);
    color: var(--danger-text);
}

/* --- MISC STYLES --- */

/* Container for Google Translate */
.translate-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    /* Note: Direct styling of the Google Translate widget is very limited */
}
/* --- Status/Icon Styles --- */
.status-icon {
    font-size: 4rem; /* Large icon size */
    color: var(--accent-blue); /* Using the blue accent for consistency */
    display: block;
    margin-bottom: 1rem;
}