/* =================== Global Reset & Fonts =================== */
:root {
    --bg-dark: #0f172a;       
    --accent-primary: #0ea5e9; 
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.public-page {
    /* Mobile-first background: Darker overlay for better contrast */
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.85)), 
                url('../images/public_loginbg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Reduced padding for mobile screens */
}

/* =================== Card Container =================== */
.public-container {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center; /* Center alignment for success page */
}

/* =================== Branding (Logo) =================== */
.brand-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-logo {
    /* KEEPING YOUR PREFERRED SIZE */
    max-width: 250px; 
    height: auto;
    display: inline-block;
}

/* =================== Typography =================== */
.public-container h2 {
    color: var(--bg-dark);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* =================== Form Elements =================== */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left; /* Reset text align for forms */
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Desktop: 2 columns */
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

/* Mobile Friendly Inputs */
.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px; /* Larger tap area */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px; /* Vital for iOS: prevents auto-zoom */
    color: var(--text-primary);
    background: #f8fafc;
    -webkit-appearance: none; /* Removes default iOS styling */
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* =================== Buttons (Fixed for Success Page) =================== */
/* General Button Style */
button {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

/* Primary Button (Dark Navy) - Used for Submit & "Submit Another" */
.submit-btn, 
button[type="submit"], 
button[type="button"] {
    background: var(--bg-dark);
    color: #fff;
}

button:hover, .submit-btn:hover {
    background: #334155;
    transform: translateY(-1px);
}

button:active {
    transform: scale(0.98);
}

/* Secondary Button (White/Gray) - Used for 'Close' */
.btn-secondary {
    background: #fff !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-secondary:hover {
    background: #f8fafc !important;
    color: var(--text-primary) !important;
    border-color: #94a3b8 !important;
}

/* =================== Success Page Icon =================== */
.success-icon {
    font-size: 60px;
    color: #16a34a; /* Green */
    margin-bottom: 20px;
    display: block;
}

/* =================== Mobile Responsive Rules =================== */
@media (max-width: 600px) {
    body.public-page {
        align-items: flex-start; /* Aligns to top on mobile so keyboard doesn't hide it */
        padding: 0;
    }

    .public-container {
        border-radius: 0; /* Full width, no corners */
        min-height: 100vh;
        box-shadow: none;
        padding: 25px 20px 40px 20px; /* Extra bottom padding for scrolling */
    }

    .form-row {
        grid-template-columns: 1fr; /* Stack everything in 1 column */
        gap: 15px;
    }

    .form-logo {
        /* KEEPING YOUR PREFERRED SIZE */
        max-width: 250px; 
    }
}