/* Shared authentication styles for login and register pages */
* {
    box-sizing: border-box;
}

.bg-image {
    /* The image used */
    background-image: url("images/manhattan_showroom_1_medium_resolution.jpg");

    /* Control the height of the image */
    height: 100vh;

    /* Center and scale the image nicely */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: -1; /* Ensure the background image is behind the container */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    line-height: 1.6;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    z-index: 1; /* Ensure the container is above the background image */
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Login specific container width */
.container.login {
    width: 400px;
    max-width: 90vw;
}

/* Register specific container width */
.container.register {
    width: 520px;
    max-width: 90vw;
}

h1 {
    color: #1a1a1a;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h2 {
    color: #4a5568;
    margin-bottom: 32px;
    font-size: 16px;
    font-weight: 400;
}

/* Form field container for better spacing */
.field-group {
    margin-bottom: 24px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 16px;
    margin: 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: #9ca3af;
}

button[type="submit"],
input[type="submit"] {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s ease;
    margin-top: 24px;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

button[type="submit"]:hover,
input[type="submit"]:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(40, 167, 69, 0.3);
}

button[type="submit"]:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

/* Advanced styling touches */
@media (max-width: 480px) {
    .container {
        padding: 32px 24px;
        margin: 16px;
    }
    
    .container.login {
        width: auto;
    }
    
    h1 {
        font-size: 20px;
    }
}

/* Loading state for button */
button[type="submit"]:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Focus-visible for better accessibility */
button[type="submit"]:focus-visible {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Subtle animation on load */
.container {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error {
    color: #ef4444;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    text-align: left;
}

.links {
    margin-top: 32px;
}

.links p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.links a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.links a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Password validation styles */
#message {
    display: none;
    background: #f1f1f1;
    color: #000;
    position: relative;
    padding: 20px;
    margin-top: 10px;
    text-align: left;
}

#message p {
    padding: 10px 35px;
    font-size: 18px;
}

.valid {
    color: green;
}

.valid:before {
    position: relative;
    left: -35px;
    content: "✔";
}

.invalid {
    color: red;
}

.invalid:before {
    position: relative;
    left: -35px;
    content: "✖";
}

/* Input validation styles */
input.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
