:root {
    --primary-color-compulog: #15B999;
    --primary-hover: #0f876f;
    --bg-color: #F8F9F9;
    --bg-surface: #FFFFFF;
    --text-color: #181C1B;
    --text-muted: #6B7280;
    --border-color: #D8DCDE;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.06);
    --radius-md: 4px;
    --radius-lg: 8px;
}

html.dark-mode {
    --primary-color-compulog: #15B999;
    --primary-hover: #0f876f;
    --bg-color: #17181A;
    --bg-surface: #1E1F21;
    --text-color: #E6E8EA;
    --text-muted: #9CA3AF;
    --border-color: #2E3033;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(21, 185, 153, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(21, 185, 153, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.login-container {
    background: var(--bg-surface);
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    background: var(--primary-color-compulog);
    transition: background 0.3s ease;
}

html.dark-mode .logo-wrap {
    background: transparent;
}

.logo {
    width: 140px;
    transition: filter 0.3s ease;
}

html.dark-mode .logo {
    filter: none;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.flash-messages {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.flash-messages li {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    font-size: 0.85em;
    font-weight: 500;
}

.flash-messages .success {
    background-color: rgba(21, 185, 153, 0.1);
    color: var(--primary-color-compulog);
    border: 1px solid rgba(21, 185, 153, 0.25);
}

.flash-messages .error {
    background-color: rgba(217, 83, 79, 0.1);
    color: #D9534F;
    border: 1px solid rgba(217, 83, 79, 0.25);
}

html.dark-mode .flash-messages .success {
    background-color: rgba(21, 185, 153, 0.15);
    border-color: rgba(21, 185, 153, 0.3);
}

html.dark-mode .flash-messages .error {
    background-color: rgba(217, 83, 79, 0.15);
    border-color: rgba(217, 83, 79, 0.3);
}

form {
    text-align: left;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
}

input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-color);
    background: var(--bg-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus {
    border-color: var(--primary-color-compulog);
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 185, 153, 0.1);
}

.senha-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.senha-container input {
    flex: 1;
    padding-right: 45px;
    height: 42px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password:hover {
    color: var(--primary-color-compulog);
    background: rgba(21, 185, 153, 0.08);
}

.toggle-password i {
    display: block;
    pointer-events: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    margin-top: 24px;
    background-color: var(--primary-color-compulog);
    border: none;
    border-radius: var(--radius-md);
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-login:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(21, 185, 153, 0.3);
}

.btn-login:active {
    transform: translateY(1px);
}

.theme-toggle-login {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 10;
}

.theme-toggle-login:hover {
    color: var(--primary-color-compulog);
    border-color: var(--primary-color-compulog);
    background: rgba(21, 185, 153, 0.08);
}

@media (max-width: 480px) {
    .login-container {
        margin: 16px;
        padding: 30px 24px;
    }

    .logo {
        width: 130px;
    }
}
