/* ============================================
   EDITAL LEME - Estilos do Portal Principal
   ============================================ */

:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --accent: #3498db;
    --bg: #f0f2f5;
    --white: #ffffff;
    --text: #2c3e50;
    --text-muted: #6c757d;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ========== LOGIN ========== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    margin: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 48px;
    color: #fdbb2d;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.login-header h2 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-login:hover { background: #2980b9; }
.btn-login:disabled { background: #95a5a6; cursor: wait; }

.login-divider {
    display: flex;
    align-items: center;
    margin: 16px 0 12px;
    gap: 12px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #d6dbe4;
}
.login-divider span {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-face-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}
.btn-face-login:hover { opacity: 0.9; }

.btn-link-action {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #d6dbe4;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.btn-link-action:hover {
    background: #eef4fb;
    border-color: #b8c7dc;
}

.password-strength {
    width: calc(100% - 2em);
    margin: -4px auto 8px;
    text-align: left;
}

.password-strength-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.password-strength-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 16%;
    border-radius: 999px;
    transition: width 0.2s ease, background 0.2s ease;
}

.password-strength-fill.is-weak {
    background: #dc2626;
}

.password-strength-fill.is-medium {
    background: #d97706;
}

.password-strength-fill.is-strong {
    background: #16a34a;
}

/* ========== TOPBAR ========== */

.topbar {
    background: var(--primary);
    color: white;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-icon {
    font-size: 28px;
    color: #fdbb2d;
}

.topbar-left h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.topbar-left span {
    font-size: 0.8rem;
    opacity: 0.7;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right span {
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    padding: 8px 18px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.25); }

.btn-topbar {
    padding: 8px 18px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.btn-topbar:hover { background: rgba(255,255,255,0.25); }

/* ========== GRID DE APLICATIVOS ========== */

.apps-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.apps-grid {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.app-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 4px solid #ccc;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 14px;
    color: white;
}

.app-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.app-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.no-apps {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.apps-content {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 30px 36px;
}

.apps-section {
    margin-bottom: 26px;
}

.apps-section-highlight {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.10), rgba(253, 187, 45, 0.12));
    border: 1px solid rgba(52, 152, 219, 0.16);
    border-radius: 20px;
    padding: 8px 0 12px;
}

.apps-section-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.apps-section-header h2 {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.apps-section-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.apps-section-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(44, 62, 80, 0.08);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.apps-grid {
    padding: 8px 30px 0;
    margin: 0 auto;
}

.apps-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.app-card {
    position: relative;
    overflow: hidden;
}

.app-card-favorite {
    box-shadow: 0 10px 28px rgba(253, 187, 45, 0.18);
}

.app-favorite-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(44, 62, 80, 0.12);
    background: rgba(255, 255, 255, 0.96);
    color: #b45309;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    z-index: 2;
}

.app-favorite-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 14px rgba(180, 83, 9, 0.18);
}

.app-favorite-toggle.is-active {
    background: #fff7ed;
    border-color: rgba(180, 83, 9, 0.26);
}

.app-favorite-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #b45309;
    font-size: 0.74rem;
    font-weight: 700;
}

/* ========== RESPONSIVO ========== */

@media (max-width: 768px) {
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        padding: 16px;
        gap: 12px;
    }
    .topbar { padding: 12px 16px; }
    .topbar-left h1 { font-size: 1rem; }
    .topbar-left span { display: none; }
}

@media (max-width: 480px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .login-card { padding: 24px; }
}

.recaptcha-wrap {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #d6dbe4;
    border-radius: 10px;
    background: #f8fafc;
}

.recaptcha-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.recaptcha-help {
    display: block;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.recaptcha-wrap .g-recaptcha {
    transform-origin: left top;
}

@media (max-width: 480px) {
    .recaptcha-wrap .g-recaptcha {
        transform: scale(0.92);
    }
}
@media (max-width: 768px) {
    .apps-content {
        padding: 16px 16px 28px;
    }

    .apps-section-header {
        padding: 0 0 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .apps-grid {
        padding: 8px 0 0;
    }
}