/* Modern, accessible CSS for JWT Auth app - Dark Mode */

:root {
    --primary-color: #4dabf7;
    --secondary-color: #6c757d;
    --success-color: #4caf50;
    --error-color: #f44336;
    --background-color: #121212;
    --container-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --border-radius: 8px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
    margin: 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

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

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 1rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

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

.switch-link a {
    color: var(--primary-color);
    text-decoration: none;
}

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

.message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 600;
}

.message.success {
    background-color: #1b5e20;
    color: #81c784;
    border: 1px solid #4caf50;
}

.message.error {
    background-color: #b71c1c;
    color: white;
    border: 1px solid #f44336;
}

.protected-content {
    margin: 2rem 0;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    text-align: center;
}

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }
}

/* Accessibility: Focus indicators */
.btn:focus,
input:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --background-color: black;
        --container-bg: #000000;
        --text-color: white;
        --border-color: white;
    }
}