/* Import Google Font - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables for easy customization */
:root {
    --primary-blue: #2563eb; /* Strong blue for branding/actions */
    --primary-blue-dark: #1e40af; /* Darker blue for hover */
    --accent-green: #10b981; /* For success/highlight */
    --text-dark: #1f2937; /* Main text color */
    --text-muted: #6b7280; /* Secondary text color */
    --background-light: #f3f4f6; /* Light gray background */
    --panel-bg: #ffffff; /* White background for panels */
    --border-color: #e5e7eb; /* Light border color */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --border-radius-lg: 0.75rem; /* 12px */
    --border-radius-md: 0.5rem;   /* 8px */
    --transition-speed: 0.2s ease-in-out;
}

.login-page {
    display: flex;
    max-width: 800px; /* Overall max width for the two-panel layout */
    width: 75%; /* Responsive width */
    border-radius: var(--border-radius-lg);
    overflow: hidden; /* Ensures rounded corners are respected by children */
    box-shadow: var(--shadow-md);
    background-color: var(--panel-bg); /* Default background for panels */
    align-items: stretch; /* Ensures both panels stretch to the same height */
}

/* --- Login Panel Base Styles --- */
.login-panel {
    padding: 2.5rem; /* Consistent padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* --- Signup Prompt Panel --- */
.signup-prompt {
    flex: 1; /* This panel will take up the remaining space */
    background-color: var(--primary-blue);
    color: white;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
}

.signup-prompt .text {
    z-index: 1; /* Ensure text is above any background effects */
}

.signup-prompt p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.signup-prompt .btn-outline {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 2px solid white;
    border-radius: var(--border-radius-md);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.signup-prompt .btn-outline:hover {
    background-color: white;
    color: var(--primary-blue);
}

/* --- Form Container Panel --- */
.form-container {
    background-color: var(--panel-bg);
    flex-basis: 60%; /* Tries to be 450px wide */
    flex-grow: 0;      /* Does not grow beyond flex-basis */
    flex-shrink: 0;    /* Does not shrink below flex-basis unless absolutely necessary */
    max-width: 540px; /* Adjusted max-width to complement flex-basis for larger screens */
    padding: 2.5rem 3.5rem; /* Increased horizontal padding for more space */
}

.highlight {
  position: relative;
}

.highlight::after {
  content: "BW";
  display: inline-block;
  font-size: 0.5em;           /* smaller than the base text */
  vertical-align: sub;        /* subscript alignment */
  margin-left: 0.25ch;        /* slight gap before the circle */
  padding: 0.3em 0.6em;       /* control circle size */
  line-height: 1;             /* prevent extra height */
  border: 1px solid currentColor;
  border-radius: 50%;
  text-align: center;
  box-sizing: content-box;    /* padding drives circle dimensions */
}

.form-container .logo {
    margin-bottom: 2rem;
}

.form-container .logo img {
    max-width: 80px; /* Adjust logo size */
    height: auto;
    margin-bottom: 0.75rem;
}

.form-container .logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.form-container .logo .highlight {
    color: var(--primary-blue);
}

.login-error {
    background-color: #fee2e2; /* Light red background */
    color: #dc2626; /* Dark red text */
    border: 1px solid #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
}

.learner-login-form {
    width: 100%;
    max-width: 350px; /* Max width for the form elements themselves */
    text-align: left;
}

.learner-login-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.learner-login-form input[type="text"],
.learner-login-form input[type="password"],
.learner-login-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--background-light); /* Slightly off-white input background */
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.learner-login-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.learner-login-form input:focus,
.learner-login-form select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    outline: none;
    background-color: white;
}

.learner-login-form select {
    /* Custom arrow for select if needed, otherwise browser default */
    -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='%236b7280' 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: 0.8em 0.8em;
}

.form-actions {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center;   /* Center items horizontally within the column */
    margin-top: 1.5rem;
    gap: 1rem; /* Space between stacked items */
}

.form-actions .btn-primary {
    order: 1; /* Make the button appear first visually */
    width: 100%; /* Make button full width within form-actions */
    padding: 0.75rem 2rem;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-actions .btn-primary:hover {
    background-color: var(--primary-blue-dark);
    box-shadow: var(--shadow-sm);
}

.form-actions .btn-primary:active {
    transform: translateY(1px);
}

.form-actions .forgot-password {
    order: 2; /* Make the link appear second visually */
    font-size: 0.9rem;
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-speed), text-decoration var(--transition-speed);
    /* No need for margin-top here as gap handles spacing */
}

.form-actions .forgot-password:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

.t-and-c {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

.t-and-c a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-speed), text-decoration var(--transition-speed);
}

.t-and-c a:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .login-page {
        flex-direction: column; /* Stack panels vertically on small screens */
        max-width: 450px; /* Single column max width */
        box-shadow: none; /* Remove overall shadow for mobile */
        border-radius: 0; /* Remove overall border-radius for mobile */
        width: 100%; /* Full width on mobile */
    }

    .login-panel {
        padding: 1.5rem; /* Reduced padding for mobile */
        width: 100%; /* Ensure panels take full width */
        box-shadow: var(--shadow-md); /* Add shadow to individual panels */
        border-radius: var(--border-radius-lg);
        margin-bottom: 1rem; /* Space between stacked panels */
    }

    .signup-prompt {
        border-bottom-left-radius: 0; /* Adjust corners when stacked */
        border-bottom-right-radius: 0;
    }

    .form-container {
        border-top-left-radius: 0; /* Adjust corners when stacked */
        border-top-right-radius: 0;
        margin-bottom: 0; /* No bottom margin for the last panel */
    }

    .login-page > .login-panel:first-child {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .login-page > .login-panel:last-child {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        margin-bottom: 0;
    }

    .form-container .logo h1 {
        font-size: 1.8rem;
    }

    .learner-login-form {
        max-width: 100%; /* Allow form to take full panel width */
    }

    .form-actions {
        /* These properties are already set for all screen sizes now,
           but explicitly ensure they are not overridden in media query if needed. */
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .form-actions .btn-primary {
        width: 100%;
    }

    .form-actions .forgot-password {
        text-align: center; /* Ensure it's centered if it was not before */
        width: 100%; /* Ensure it takes full width for centering */
    }
}
