* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

body {
    min-height: 100vh;
    font-family: 'Poppins', 'Trebuchet MS', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
    color: #1f2937;
    background: #f5f5f5;
}

#topo {
    width: 100%;
    height: 50px;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(to right, #c0392b 47%, #7a4951 73%, #114455 87%);
    display: flex;
    align-items: center;
    z-index: 100;
}

#textotop {
    padding-left: 20px;
    font-size: clamp(22px, 5vw, 30px);
    color: #fff;
    font-weight: 500;
}

.theme-toggle-btn {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent; 
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: all 0.4s ease;
    padding: 8px;
}

.theme-toggle-btn:hover {
    background: #114455; 
    transform: translateY(-50%) rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-icon {
    width: 100%;
    height: 100%;
    filter: brightness(0) invert(1); 
    object-fit: contain;
}

#log {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #ffffff;
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
}

.mens {
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1f2937;
}

.campo { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    margin-bottom: 5px;
}

.linha-dupla { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
}

label { 
    font-weight: 600; 
    color: #1F2937; 
    font-size: 14px;
    margin-bottom: 2px;
}

input, select {
    height: 48px;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    background-color: #f9fafb;
    outline: none;
    color: #1f2937;
}

input:hover, select:hover {
    border-color: #c0392b;
}

input:focus, select:focus {
    border-color: #c0392b;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

#logbtn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    background-color: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    outline: none;
}

#logbtn:hover {
    background-color: #114455;
    box-shadow: 0 5px 15px rgba(17, 68, 85, 0.4);
}

#logbtn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

a {
    color: #c0392b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

a:hover { 
    color: #114455; 
    text-decoration: underline; 
}

.campo-consentimento {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
}

.label-checkbox {
    display: flex;
    align-items: center; 
    gap: 10px;
    cursor: pointer;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
}

.label-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background-color: #fff;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none !important;
    flex-shrink: 0;
    margin: 0; 
}

.label-checkbox input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.label-checkbox input[type="checkbox"]:checked {
    background-color: #c0392b;
    border-color: #c0392b;
}

.label-checkbox input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.label-checkbox input[type="checkbox"]:hover {
    border-color: #c0392b;
}

.label-checkbox input[type="checkbox"]:focus,
.label-checkbox input[type="checkbox"]:active {
    outline: none !important;
    box-shadow: none !important;
}

#mensagem-erro, #mensagem-sucesso {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

#mensagem-erro { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
#mensagem-sucesso { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }


[data-theme="dark"] body {
    background: #121212;
    color: #e8e8e8;
}

[data-theme="dark"] #log {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .mens, 
[data-theme="dark"] label,
[data-theme="dark"] .label-checkbox {
    color: #e8e8e8;
}

[data-theme="dark"] input, 
[data-theme="dark"] select {
    background: #1a1a1a;
    border-color: #333;
    color: #e8e8e8;
}

[data-theme="dark"] .campo-consentimento {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .label-checkbox input[type="checkbox"] {
    background-color: #121212;
    border-color: #444;
}

[data-theme="dark"] .label-checkbox input[type="checkbox"]:checked {
    background-color: #c0392b;
    border-color: #c0392b;
}

[data-theme="dark"] #mensagem-erro {
    background: rgba(254, 226, 226, 0.1);
    border-color: rgba(252, 165, 165, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] #mensagem-sucesso {
    background: rgba(209, 250, 229, 0.1);
    border-color: rgba(110, 231, 183, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] a {
    color: #e8e8e8;
}

[data-theme="dark"] a:hover {
    color: #3498db;
}

[data-theme="dark"] .theme-toggle-btn {
    background: transparent;
    border: none;
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: #3498db;
}