:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.login-card,
.register-card,
.success-card,
.error-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
}

.success-card,
.error-card {
    max-width: 500px;
    text-align: center;
}

.icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.register-card {
    max-width: 500px;
}

.login-header,
.register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1,
.register-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
}

.login-header p,
.register-header p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.875rem;
}

.header-separator {
    height: 2px;
    width: 100%;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
    margin: 1.5rem 0;
    opacity: 0.6;
    border-radius: 1px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

label .required {
    color: #dc2626;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.error {
    border-color: #dc2626;
}

.error-message {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

button,
input[type="button"],
input[type="submit"],
.btn-secondary {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 0.95rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

button:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    margin-top: 0.75rem;
}

.btn-secondary:hover {
    background-color: #eff6ff;
}

.error-list {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    list-style: none;
}

.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
}

.message.success {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.message.error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.forgot-link {
    font-size: 0.875rem; 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 500;
}

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

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    background: var(--card-bg);
    padding: 0 1rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
