/* CSS Variables for Theme Support */
:root {
    /* Light theme (default) */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-header: #2c3e50;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-inverse: #ffffff;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-primary: #3498db;
    --accent-secondary: #2980b9;
    --error-color: #e74c3c;
    --link-color: #2980b9;
    --link-hover-color: #1a5490;
}

/* Dark theme (browser preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-header: #1f1f1f;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --text-inverse: #ffffff;
        --border-color: #404040;
        --shadow-color: rgba(0, 0, 0, 0.3);
        --accent-primary: #4a90e2;
        --accent-secondary: #357abd;
        --error-color: #e74c3c;
        --link-color: #6ab0f3;
        --link-hover-color: #8ec5f6;
    }
}

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

/* Body styles for login page */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Login page specific styles */
body.login-page {
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Portal page specific styles */
body.portal-page {
    background-color: var(--bg-primary);
}

/* Login container */
.login-container {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px var(--shadow-color);
    width: 100%;
    max-width: 400px;
}

h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
}

button:hover {
    transform: translateY(-2px);
    background-color: var(--accent-secondary);
}

button:active {
    transform: translateY(0);
}

.error-message {
    color: var(--error-color);
    text-align: center;
    margin-bottom: 1rem;
    display: block;
}

/* Message container for status/error messages */
.message-container {
    max-width: 600px;
    margin: 2rem auto 1rem auto;
    padding: 0;
}

.message-container .error-message,
.message-container .success-message {
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message-container .error-message {
    background-color: #fee;
    border-left: 4px solid #c33;
    color: #c33;
}

.message-container .success-message {
    background-color: #efe;
    border-left: 4px solid #3c3;
    color: #2a7f2a;
}

.success-message {
    color: #2a7f2a;
    text-align: center;
    margin-bottom: 1rem;
    display: block;
}

/* Link styles */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Header styles for portal page */
.header {
    background-color: var(--bg-header);
    padding: 15px;
    text-align: center;
}

.header a {
    color: var(--text-inverse);
    text-decoration: none;
    margin: 0 20px;
    font-size: 18px;
}

.header a:hover {
    text-decoration: underline;
}

/* Iframe styles for portal page */
iframe {
    width: 100%;
    height: calc(100vh - 50px);
    border: none;
}
