/* ============================================================
   MAINEP - Authentication System - Unified Stylesheet
   Escopo: body.page-login | body.page-register | body.page-profile
   ============================================================ */

/* ---------- Reset / Base (todas as páginas) ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px;
    color: #e0e0e0;
}

small { color: #aaa; font-size: 12px; }
::placeholder { color: #888; }

/* ---------- Logo (todas as páginas) ---------- */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
}

.svg-logo {
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    transition: transform 0.5s ease;
}
.svg-logo:hover { transform: scale(1.05); }

.text-logo span { transition: transform 0.3s ease; }
.text-logo span:hover { transform: translateY(-10px); }

/* ---------- Container base (login/register) ---------- */
.container {
    max-width: 550px;
    margin: 20px auto;
    background: #1e1e1e;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.container.container-login {
    max-width: 500px;
    padding: 20px;
}

/* ---------- Headings base ---------- */
h1, h2, h3 {
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
}

/* ---------- Tabs (login/register) ---------- */
.tabs {
    display: flex;
    background: #252525;
    border: 1px solid #444;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tabs a {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: #aaaaaa;
    background: #2d2d2d;
    border-bottom: 2px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tabs a:hover { background: #383838; color: #e0e0e0; }
.tabs a.active {
    background: #86dd8a;
    color: #1e1e1e;
    border-bottom: 2px solid #4CAF50;
}

/* ---------- Form genérico ---------- */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #cccccc;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="date"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px;
    background-color: #2d2d2d;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #4CAF50;
    outline: none;
}

input.is-invalid { border-color: #f44336; }
input.is-valid   { border-color: #4CAF50; }

textarea { resize: vertical; min-height: 100px; }

/* ---------- File input ---------- */
input[type="file"] { background-color: #333; padding: 8px; }
input[type="file"]::file-selector-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}
input[type="file"]::file-selector-button:hover { background-color: #45a049; }

/* ---------- Select com seta ---------- */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ---------- Feedback ---------- */
.feedback { font-size: 12px; margin-top: 5px; display: block; }
.feedback-error   { color: #ff8a80; }
.feedback-success { color: #80ffa0; }

/* ---------- Botões base ---------- */
button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
}
button:hover:not(:disabled) { background-color: #45a049; }
button:disabled { background-color: #555; cursor: not-allowed; }

.btn-secondary { background-color: #5a6268; }
.btn-secondary:hover { background-color: #4a5258; }

.logout-btn {
    background-color: #d32f2f;
    width: auto;
    display: inline-block;
    text-decoration: none;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
}
.logout-btn:hover { background-color: #b71c1c; }

/* ---------- Alerts ---------- */
.alert { padding: 10px; margin-bottom: 15px; border-radius: 4px; }
.alert-error {
    background-color: #3a1a1a;
    color: #ff8a80;
    border: 1px solid #5d2a2a;
}
.alert-success {
    background-color: #1a3a2a;
    color: #80ffa0;
    border: 1px solid #2a5d3a;
}

/* ---------- CAPTCHA ---------- */
.captcha-group {
    margin: 20px 0;
    padding: 15px;
    background-color: #252525;
    border-radius: 4px;
    border: 1px solid #444;
}
.captcha-image {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background-color: #2d2d2d;
    cursor: pointer;
}
.refresh-captcha {
    background-color: #2196F3;
    margin-top: 10px;
    width: auto;
    padding: 6px 12px;
    font-size: 14px;
}
.refresh-captcha:hover { background-color: #0b7dda; }
.captcha-description {
    font-size: 12px;
    color: #aaa;
    margin-top: 8px;
    text-align: center;
}

/* ---------- Footer links ---------- */
.login-link,
.register-link {
    text-align: center;
    margin-top: 20px;
    color: #cccccc;
}
.login-link a,
.register-link a { color: #4CAF50; text-decoration: none; }
.login-link a:hover,
.register-link a:hover { text-decoration: underline; }

/* ---------- "Remember me" ---------- */
.remember-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: #cccccc;
}

/* ============================================================
   PROFILE PAGE (escopo: body.page-profile)
   ============================================================ */

/* ---------- Container do profile (800px) ---------- */
.page-profile .container {
    max-width: 800px;
    margin: 15px auto;
    padding: 20px;
}

/* ---------- Headings do profile (alinhados à esquerda) ---------- */
.page-profile h1,
.page-profile h2,
.page-profile h3 {
    text-align: left;
}

/* ---------- Nav links ---------- */
.page-profile .nav-links { margin-bottom: 20px; }
.page-profile .nav-links a {
    color: #4CAF50;
    text-decoration: none;
    margin-right: 15px;
}
.page-profile .nav-links a:hover {
    text-decoration: underline;
    color: #45a049;
}

/* ---------- User header ---------- */
.page-profile .user-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}
.page-profile .avatar-container {
    position: relative;
    margin-right: 20px;
}
.page-profile .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4CAF50;
    background-color: #2d2d2d;
}
.page-profile .user-info { flex: 1; }
.page-profile .user-email {
    color: #aaa;
    margin-bottom: 5px;
}
.page-profile .user-role {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    background-color: #388e3c;
    color: white;
}

/* ---------- Form sections ---------- */
.page-profile .form-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #252525;
    border: 1px solid #444;
    border-radius: 8px;
}
.page-profile .form-section h2 {
    text-align: left;
}
.page-profile .form-group {
    margin-bottom: 15px;
}

/* ---------- Char counter ---------- */
.page-profile .char-count {
    font-size: 12px;
    color: #aaa;
    text-align: right;
}

/* ---------- Avatar actions ---------- */
.page-profile .avatar-actions { margin-top: 10px; }

/* ---------- Stats grid ---------- */
.page-profile .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.page-profile .stat-item {
    padding: 15px;
    background-color: #252525;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid #4CAF50;
}
.page-profile .stat-label {
    display: block;
    font-size: 14px;
    color: #aaa;
    margin-bottom: 5px;
}
.page-profile .stat-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

/* ---------- Botões do profile ---------- */
.page-profile button {
    width: 100%;
    padding: 12px;
}
.page-profile .avatar-actions button {
    width: auto;
}

/* ---------- Responsive do profile ---------- */
@media (max-width: 600px) {
    .page-profile .user-header {
        flex-direction: column;
        text-align: center;
    }
    .page-profile .avatar-container {
        margin-right: 0;
        margin-bottom: 15px;
    }
}