:root {
    --bg-light: #e9e9e9;
    --text-light: #333;
    --bg-dark: #1f1f1f;
    --text-dark: #f0f0f0;
    --container-bg-light: #dadada;
    --container-bg-dark: #1b1a19;
    --primary: #0078d4;
    --primary-hover: #004982;
    --error: red;
    --success: green;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-theme {
    background-color: var(--bg-light);
    color: var(--text-light);
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

body.light-theme .title-container,
body.light-theme .login-container {
    background-color: var(--container-bg-light);
}

body.dark-theme .title-container,
body.dark-theme .login-container {
    background-color: var(--container-bg-dark);
}

.title-wrapper {
    display: flex;
    align-items: center;
    max-width: 680px; /* 600px for title-container + 80px for icon-wrapper */
    margin: 40px auto;
    gap: 0; /* No gap between icon and title-container */
}

.title-container {
    max-width: 600px; /* Matches login-container */
    background-color: inherit;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    flex: 1; /* Takes up remaining space */
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the title text */
}

.title-row h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    word-break: break-word;
    text-align: center;
}

.icon-wrapper {
    width: 80px; /* Large circle */
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
    margin-right: -20px; /* Overlaps slightly with title-container for visual connection */
    z-index: 1; /* Ensures icon is above title-container */
}

body.dark-theme .icon-wrapper {
    background-color: var(--primary);
}

.icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.login-container {
    max-width: 600px;
    margin: 40px auto;
    background-color: inherit;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px; /* match logo height */
    position: relative;
}


.logo-container img {
    max-height: 120px;
    margin-bottom: 10px;
    display: block;
}

h1 {
    font-size: 28px;
    margin: 0;
}

.login-body p {
    margin-bottom: 16px;
}

input {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: inherit;
    color: inherit;
    transition: border-color 0.3s ease;
}

body.dark-theme input {
    border: 1px solid #555;
}

body.light-theme #logoLight { display: none; }
body.dark-theme #logoDark { display: none; }
body.light-theme #logoDark { display: block; }
body.dark-theme #logoLight { display: block; }

select {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: inherit;
    color: inherit;
    transition: border-color 0.3s ease;
}

body.dark-theme select {
    border: 1px solid #555;
}

.submit-button {
    display: block;
    margin: 0 auto;
    background-color: var(--primary);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: var(--primary-hover);
}

.success {
    color: var(--success);
    font-weight: bold;
    text-align: center;
}

.error {
    color: var(--error);
    font-weight: bold;
    text-align: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.theme-icon {
    margin-left: 8px;
    font-size: 1.3rem;
    transition: opacity 0.3s ease;
}

.theme-toggle-wrapper {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.05);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 1000;
}

.message-card {
    max-width: 500px;
    margin: 20px auto;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.error-card {
    background-color: rgba(255, 0, 0, 0.1);
    color: var(--error);
    border-left: 6px solid var(--error);
}

.success-card {
    background-color: rgba(0, 128, 0, 0.1);
    color: var(--success);
    border-left: 6px solid var(--success);
}

.warning-card {
    background-color: rgba(255, 165, 0, 0.1);
    color: #cc8400;
    border-left: 6px solid #cc8400;
}