/* Reset / Basic Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f9fafb; /* Light gray background */
    color: #1f2937; /* Dark gray text */
    min-height: 100vh;
    padding-top: 4rem; /* Add padding to body top to prevent overlap if header is fixed/sticky */
}

/* Header */
header.global-header {
    position: fixed; /* Or absolute, or sticky. Fixed keeps it visible on scroll */
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff; /* White background */
    padding: 0.75rem 1.5rem; /* Adjust padding as needed */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    z-index: 1000; /* Ensure header stays on top */
    display: flex; /* Use flex to align items inside header */
    justify-content: flex-end; /* Align language switcher to the right */
    align-items: center;
}

/* Container and Card */
.auth-container {
    width: 100%;
    max-width: 450px; /* Limit card width */
    margin: 2rem auto 0; /* Added top margin, keep horizontal auto centering */
}

.auth-card {
    background-color: #ffffff;
    padding: 2rem; /* More padding */
    border-radius: 1rem; /* Rounded corners */
    margin: 1rem;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    display: block;
    margin: 1rem auto 2rem;
    padding-right: 1%;
    height: 1.5rem;
    color: #4f46e5; /* Indigo */
}

.auth-header h2 {
    font-size: 1.875rem; /* 30px */
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #6b7280; /* Medium gray */
    font-size: 0.875rem; /* 14px */
}

/* Dividers */
.divider {
    position: relative;
    text-align: center;
    margin: 2rem 0 1rem;
    border-top: 1px solid #e5e7eb; /* Light border */
}

.divider span {
    position: relative;
    top: -0.875rem; /* Adjust vertical position */
    background-color: #ffffff; /* Match card background */
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Social Logins */
.social-logins {
    margin-bottom: 2rem;
}

#g_signin {
    display: flex;
    justify-content: center;
    width: 100%;
}

.social-buttons {
    display: grid;
}

.btn.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db; /* Gray border */
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: background-color 0.2s ease-in-out;
}

.btn.btn-social:hover {
    background-color: #f9fafb;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Space between form elements */
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.075);
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5; /* Indigo */
    box-shadow: 0 0 0 1px #4f46e5;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

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

.form-check input[type="checkbox"] {
    height: 1rem; /* 16px */
    width: 1rem;
    margin-right: 0.5rem;
    border-radius: 0.25rem;
    border-color: #d1d5db;
    color: #4f46e5; /* Indigo check */
    cursor: pointer;
}

.form-check label {
    color: #374151;
    cursor: pointer;
}

.link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

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

.form-actions {
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
    width: 100%; /* Make buttons full width by default */
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #4f46e5; /* Indigo */
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #4338ca; /* Darker Indigo */
}

/* Footer Link */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-footer .divider {
    margin-bottom: 0.5rem; /* Less margin above text */
}

.auth-footer .divider span { /* Hide the text in the footer divider */
    display:none;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.alert-error {
    color: #991b1b; /* Dark Red */
    background-color: #fee2e2; /* Light Red */
    border-color: #fecaca; /* Lighter Red border */
}

.alert-success {
    color: #14532d; /* Dark Green */
    background-color: #dcfce7; /* Light Green */
    border-color: #bbf7d0; /* Lighter Green border */
}

/* HTMX Indicator Styles */
.htmx-indicator{
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator{
    opacity: 1;
}
.htmx-request.htmx-indicator{
    opacity: 1;
}

/* Example: Style for a spinner inside an indicator */
.htmx-indicator .spinner {
    border: 4px solid rgba(0, 0, 0, .1);
    border-left-color: transparent;
    border-radius: 50%;
    display: inline-block;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* @keyframes spin { to { transform: rotate(360deg); } } */ 