/* ==========================================
   ESTILOS DO SISTEMA DE INSCRIÇÃO
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Classe utilitária para esconder elementos */
.hidden {
    display: none !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('../img/technology.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #ffffff;
    padding: 30px 20px;
    text-align: center;
}

.logo {
    max-width: 70px;
    height: auto;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

.link-ver-cursos {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.link-ver-cursos:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ==========================================
   FORMULÁRIO
   ========================================== */

.form-inscricao {
    padding: 30px;
}

.fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.fieldset legend {
    font-weight: 600;
    color: #1e3a5f;
    padding: 0 10px;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2d5a87;
    box-shadow: 0 0 0 3px rgba(45, 90, 135, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   CAMPO DE SENHA
   ========================================== */

.input-senha {
    position: relative;
    display: flex;
}

.input-senha input {
    flex: 1;
    padding-right: 45px;
}

.btn-ver-senha {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.btn-ver-senha:hover {
    opacity: 1;
}

.dica-senha {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

/* ==========================================
   PLANO DE ENSINO
   ========================================== */

.plano-ensino-container {
    margin-top: 8px;
}

.link-plano-ensino {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4edda 100%);
    color: #155724;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #c3e6cb;
    transition: all 0.3s ease;
}

.link-plano-ensino:hover {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.15);
}

/* ==========================================
   REQUISITOS DE SENHA
   ========================================== */

.senha-requisitos {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.lista-requisitos {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.requisito {
    padding: 4px 0;
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requisito::before {
    content: '○';
    color: #ccc;
}

.requisito.valido {
    color: #28a745;
}

.requisito.valido::before {
    content: '✓';
    color: #28a745;
}

.requisito.invalido {
    color: #dc3545;
}

.requisito.invalido::before {
    content: '✗';
    color: #dc3545;
}

/* ==========================================
   BOTÕES
   ========================================== */

.form-actions {
    margin-top: 30px;
}

.btn-enviar {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.3);
}

.btn-enviar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.campos-obrigatorios {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 15px;
}

/* ==========================================
   MENSAGEM DE PERÍODO FECHADO
   ========================================== */

.mensagem-fechado {
    padding: 50px 30px;
    text-align: center;
}

.icone-fechado {
    font-size: 4rem;
    margin-bottom: 20px;
}

.mensagem-fechado h2 {
    color: #dc3545;
    margin-bottom: 15px;
}

.mensagem-fechado p {
    color: #666;
    margin-bottom: 10px;
}

.periodo-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.contato-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.contato-info a {
    color: #2d5a87;
    text-decoration: none;
}

.contato-info a:hover {
    text-decoration: underline;
}

.calendario-info {
    margin-top: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    border-radius: 10px;
    border-left: 4px solid #2d5a87;
}

.calendario-info p {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.calendario-info a {
    color: #2d5a87;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.calendario-info a:hover {
    color: #1a3d5c;
    text-decoration: underline;
}

/* ==========================================
   MENSAGEM DE SUCESSO
   ========================================== */

.mensagem-sucesso {
    padding: 50px 30px;
    text-align: center;
}

.icone-sucesso {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 20px;
}

.mensagem-sucesso h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.mensagem-sucesso p {
    color: #666;
    margin-bottom: 10px;
}

.btn-moodle {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin: 20px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-moodle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(30, 58, 95, 0.3);
}

.credenciais {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
}

.credenciais p {
    margin-bottom: 8px;
}

/* ==========================================
   MENSAGEM DE BLOQUEIO (LIMITE DE CURSOS)
   ========================================== */

.mensagem-bloqueio {
    padding: 50px 30px;
    text-align: center;
}

.icone-bloqueio {
    font-size: 4rem;
    margin-bottom: 15px;
}

.mensagem-bloqueio h2 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.mensagem-bloqueio p {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

.cursos-bloqueio {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: left;
}

.cursos-bloqueio p {
    color: #856404;
    margin-bottom: 8px;
}

.lista-cursos-bloqueio {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.lista-cursos-bloqueio li {
    padding: 8px 12px;
    background: #fff8e1;
    border-radius: 6px;
    margin-bottom: 6px;
    color: #5a4a00;
    font-weight: 500;
}

.instrucao-bloqueio {
    font-size: 1.05rem;
    color: #333 !important;
    font-weight: 500;
    margin-top: 15px !important;
}

.btn-plataforma {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 20px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-plataforma:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
    color: #fff;
    text-decoration: none;
}

.contato-bloqueio {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.contato-bloqueio p {
    color: #666;
    margin-bottom: 5px;
}

.contato-bloqueio a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
}

.contato-bloqueio a:hover {
    text-decoration: underline;
}

.btn-voltar-formulario {
    display: inline-block;
    padding: 10px 25px;
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 15px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-voltar-formulario:hover {
    background: #f0f0f0;
    color: #333;
}

/* ==========================================
   LOADING
   ========================================== */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #2d5a87;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    margin-top: 20px;
    color: #333;
    font-size: 1.1rem;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.footer a {
    color: #2d5a87;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ==========================================
   ALERTAS/TOASTS
   ========================================== */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 15px 45px 15px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.toast-texto {
    flex: 1;
    line-height: 1.4;
}

.toast-fechar {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
}

.toast-fechar:hover {
    opacity: 1;
}

.toast.erro {
    background: #dc3545;
}

.toast.sucesso {
    background: #28a745;
}

.toast.aviso {
    background: #ffc107;
    color: #333;
}

.toast.aviso .toast-fechar {
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVIDADE
   ========================================== */

/* Tablets e telas médias */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        max-width: 100%;
        border-radius: 10px;
    }
    
    .header {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .logo {
        max-width: 160px;
    }
    
    .form-inscricao {
        padding: 25px 20px;
    }
    
    .btn-moodle {
        padding: 12px 30px;
    }
}

/* Celulares */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.15rem;
        line-height: 1.3;
    }
    
    .header .subtitle {
        font-size: 0.85rem;
    }
    
    .logo {
        max-width: 140px;
    }
    
    .form-inscricao {
        padding: 20px 15px;
    }
    
    .fieldset {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .fieldset legend {
        font-size: 1rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 16px; /* Previne zoom no iOS */
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .btn-enviar {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .mensagem-fechado,
    .mensagem-sucesso,
    .mensagem-bloqueio {
        padding: 30px 20px;
    }
    
    .icone-fechado {
        font-size: 3rem;
    }
    
    .icone-bloqueio {
        font-size: 3rem;
    }
    
    .icone-sucesso {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .mensagem-fechado h2,
    .mensagem-sucesso h2,
    .mensagem-bloqueio h2 {
        font-size: 1.3rem;
    }
    
    .btn-moodle,
    .btn-plataforma {
        padding: 12px 25px;
        font-size: 0.95rem;
        display: block;
        text-align: center;
    }
    
    .credenciais {
        padding: 15px;
    }
    
    .footer {
        padding: 15px;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
    
    /* Toast responsivo */
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.9rem;
    }
    
    /* Requisitos de senha em coluna única */
    .senha-requisitos {
        padding: 12px;
    }
    
    .requisito {
        font-size: 0.8rem;
    }
}

/* Celulares muito pequenos */
@media (max-width: 380px) {
    body {
        padding: 5px;
    }
    
    .header {
        padding: 15px 10px;
    }
    
    .header h1 {
        font-size: 1rem;
    }
    
    .logo {
        max-width: 120px;
    }
    
    .form-inscricao {
        padding: 15px 10px;
    }
    
    .fieldset {
        padding: 12px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .dica-senha {
        font-size: 0.75rem;
    }
}

/* Landscape em celulares */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
    }
    
    .logo {
        max-width: 100px;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }
}
