/* --- Import Montserrat Font --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Variables & Theme Setup --- */
:root {
    /* Brand Colors */
    --corporate-blue: #05ADC5; /* Primary */
    --teal-green: #F5A50A;     /* Accent */
    --teal-green-hover: #d48e08;
    --charcoal-gray: #080E17;

    /* Theme Variables (Dark Default) */
    --bg-primary: #080E17;
    --bg-nav: rgba(8, 14, 23, 0.9);
    --bg-card: #101C2D;
    --bg-input: #080E17;
    --bg-button: #1B2232;
    --bg-button-hover: #20293C;
    
    --text-primary: #F8FAFC;
    --text-secondary: #838F9E;
    --text-label: #F8FAFC;
    
    --border-color: #20293C;
    --border-card: #20293C;
    
    /* Mapped Accent to Primary */
    --accent-color: #05ADC5;
    --accent-hover: #05b5bd;
    
    /* State Colors */
    --error-bg: rgba(238, 68, 68, 0.1);
    --error-border: #EE4444;
    --error-text: #EE4444;
    --success-bg: rgba(5, 173, 197, 0.1);
    --success-border: rgba(5, 173, 197, 0.2);
    --success-text: #05ADC5;

    --font-main: 'Montserrat', sans-serif;
}

/* Light theme variables */
[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-nav: rgba(255, 255, 255, 0.9);
    --bg-card: #FAFAFA;
    --bg-input: #FFFFFF;
    --bg-button: #F1F5F9;
    --bg-button-hover: #E2E8F0;
    
    /* Updated Main Text */
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-label: #0F172A;
    
    --border-color: #E2E8F0;
    --border-card: #E2E8F0;
    
    --accent-color: #05ADC5;
    --accent-hover: #048a9d;
    
    --error-bg: #fee2e2;
    --error-border: #EE4444;
    --error-text: #991b1b;
    --success-bg: #d1fae5;
    --success-border: rgba(5, 173, 197, 0.2);
    --success-text: #048a9d;
}

html, body {
    height: 100%;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Layout Structure --- */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column; /* Stack Navbar and Content vertically */
    min-height: 100vh;
    padding-top: 80px; /* Prevent Navbar Overlap */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Main Content Area --- */
.main {
    width: 100%;
    max-width: 500px; /* Slight increase for Montserrat readability */
    margin: auto; /* Centers vertically and horizontally in remaining space */
    padding: 40px 20px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-top: 80px;
    margin-bottom: 80px;
}

/* --- Card Styling --- */
.card {
    width: 100%;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); /* Softer shadow */
    border: 1px solid var(--border-card);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.card:hover {
    border-color: var(--accent-color); /* Subtle highlight on hover like homepage */
}

/* --- Typography --- */
h1, h2 {
    text-align: center;
    font-size: 1.75rem; /* Adjusted for Montserrat */
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.card > p {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    transition: color 0.3s ease;
}

/* --- Notices --- */
.notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    transition: all 0.3s ease;
}

.notice[style*="background:#fee"] {
    background: var(--error-bg) !important;
    border: 1px solid var(--error-border) !important;
    color: var(--error-text) !important;
}

/* --- Forms --- */
form {
    margin-top: 24px;
}

.form-row {
    margin-bottom: 20px;
}

.form-col {
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary); /* Darker label for better visibility */
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
    accent-color: var(--accent-color);
}

.input,
input[type="email"],
input[type="password"],
input[type="text"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(30, 155, 134, 0.15); /* Teal glow */
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-button);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
    gap: 8px;
}

.btn:hover {
    background: var(--bg-button-hover);
    border-color: var(--text-secondary);
}

/* Primary Action Button (Teal Green) */
.btn-primary {
    width: 100%;
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff; /* White text on Teal Green */
    padding: 14px 20px;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

.actions {
    margin-top: 24px;
}

/* --- Links --- */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

a:hover {
    color: var(--accent-hover);
}

/* Forgot password link specific styling */
.card > p:last-of-type {
    text-align: center;
    margin-top: 24px;
    margin-bottom: 0;
}

.card > p:last-of-type a {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card > p:last-of-type a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .card {
        padding: 32px 24px;
    }
    
    h1, h2 {
        font-size: 1.5rem;
    }
    
    .main {
        padding: 20px 16px;
    }
}