/**
 * CSS para Telas de Registro
 * Alinhado com o design system do PcD Informado
 */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
    --teal: oklch(0.52 0.10 195);
    --teal-deep: oklch(0.40 0.08 198);
    --teal-soft: oklch(0.96 0.025 195);
    --coral: oklch(0.68 0.14 35);
    --coral-soft: oklch(0.96 0.03 40);
    --plum: oklch(0.55 0.10 320);
    --plum-soft: oklch(0.96 0.025 320);
    --sun: oklch(0.78 0.11 80);
    --sun-soft: oklch(0.96 0.04 85);
    --ink: oklch(0.28 0.015 220);
    --ink-soft: oklch(0.48 0.015 220);
    --line: oklch(0.90 0.01 220);
    --paper: oklch(0.985 0.006 90);
    --color-white: #FFFFFF;
    --sun: oklch(0.78 0.11 80);
}

html {
    font-size: 18px;
}

body {
    font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

.ic {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
}

/* ============================================
   HEADER & FOOTER
   ============================================ */

header.site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    margin: 12px 60px;
    border-radius: 20px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 240px;
    width: auto;
    display: block;
}

.brand .mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--teal-soft);
}

.brand .mark .ic {
    font-size: 28px;
}

.brand .name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand .name span {
    background: linear-gradient(135deg, var(--teal), var(--coral));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand .sub {
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

nav.main {
    display: flex;
    align-items: center;
    gap: 32px;
}

nav.main a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}

nav.main a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--teal);
    transition: width 0.3s ease;
}

nav.main a:hover::after {
    width: 100%;
}

nav.main a:hover {
    color: var(--teal);
}

.btn-login {
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: #fff;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px var(--teal-soft);
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--teal-soft);
}

footer.site {
    background: #fff;
    color: var(--ink);
    padding: 32px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 60px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border-radius: 20px;
}

footer.site .fbrand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

footer.site .fbrand .mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal-deep), var(--teal));
    display: grid;
    place-items: center;
    font-size: 24px;
    color: #fff;
}

footer.site .help {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--teal-soft);
    padding: 16px 28px;
    border-radius: 99px;
    border: 1px solid var(--line);
    transition: all 0.3s ease;
}

footer.site .help:hover {
    background: oklch(0.92 0.04 195);
    transform: translateY(-2px);
}

footer.site .help .ic {
    font-size: 32px;
    color: var(--teal);
}

footer.site .help strong {
    font-size: 1.2rem;
    display: block;
    color: var(--ink);
}

footer.site .help span {
    font-size: 0.82rem;
    color: var(--ink-soft);
}

/* ============================================
   LAYOUT GERAL
   ============================================ */

.registro-section {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.registro-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: auto;
    padding: 40px 20px;
}

.registro-wrapper {
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 25px;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    animation: slideIn 0.3s ease;
}

/* ============================================
   HEADER
   ============================================ */

.registro-header {
    text-align: center;
    margin-bottom: 40px;
}

.header-emoji {
    display: inline-block;
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 8px;
    animation: wave 2.4s ease-in-out infinite;
    transform-origin: 70% 70%;
}

.registro-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--teal-deep);
    margin: 0 0 12px 0;
}

.registro-header .subtitle {
    color: var(--ink-soft);
    font-size: 1rem;
    margin: 0;
}

/* ============================================
   CARDS DE TIPO
   ============================================ */

.tipo-cards {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tipo-card {
    background: #fff;
    border: 1px solid var(--line);
    border-top: 3px solid var(--teal);
    border-radius: 8px;
    padding: 20px 14px 16px;
    text-align: center;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: visible;
}

.tipo-card:hover,
.tipo-card:focus-within {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.tipo-card .card-emoji {
    position: absolute;
    top: -14px;
    right: 14px;
    font-size: 1.6rem;
    line-height: 1;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease;
}

.tipo-card:hover .card-emoji {
    transform: scale(1.15) rotate(-8deg);
}

/* Personalidade de cada tipo de conta, usando a paleta existente */
.card-usuario { border-top-color: var(--teal); }
.card-usuario .card-icon { color: var(--teal); }

.card-prestador { border-top-color: var(--coral); }
.card-prestador .card-icon { color: var(--coral); }

.card-empresa { border-top-color: var(--plum); }
.card-empresa .card-icon { color: var(--plum); }

.card-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    color: var(--teal);
    font-size: 1.6rem;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.tipo-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
}

.card-description {
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin: 0;
    line-height: 1.2;
}

.tipo-card .btn-block .ic,
.tipo-card .btn-block span[aria-hidden] {
    display: inline-block;
    transition: transform 0.25s ease;
}

.tipo-card:hover .btn-block span[aria-hidden] {
    transform: translateX(4px);
}

/* ============================================
   MENSAGEM DE INCENTIVO (acima do formulário)
   ============================================ */

.passo-incentivo {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--teal-soft);
    color: var(--teal-deep);
    border-radius: 99px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 24px;
    animation: slideIn 0.3s ease;
}

.passo-incentivo span[aria-hidden] {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .passo-incentivo {
        border-radius: 14px;
        font-size: 0.8rem;
    }
}

/* ============================================
   FORMS
   ============================================ */

.registro-form {
    margin: 0;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink);
}

.required {
    color: var(--coral);
}

.help-text {
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: normal;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1);
}

.form-control.is-invalid {
    border-color: var(--coral);
}

.form-error {
    display: block;
    color: var(--coral);
    font-size: 0.9rem;
    margin-top: 4px;
}

.form-help {
    display: block;
    color: var(--ink-soft);
    font-size: 0.85rem;
    margin-top: 8px;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   GRUPO DE INPUT (ex: CEP + botão Buscar)
   ============================================ */

.input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    min-width: 0;
}

.input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding-left: 16px;
    padding-right: 16px;
}

@media (max-width: 480px) {
    .input-group {
        flex-direction: column;
    }
}

/* ============================================
   INPUTS ESPECIAIS
   ============================================ */

.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    display: block;
    padding: 12px;
}

#preview-foto,
#preview-logo {
    margin-top: 12px;
}

#preview-foto img,
#preview-logo-img {
    max-width: 150px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

/* ============================================
   CHECKBOXES & RADIO
   ============================================ */

.checkbox-group {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--paper);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: var(--teal-soft);
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
    align-items: center;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    z-index: -1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--line);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: white;
}

.progress-step.completed .step-number {
    background: var(--teal-soft);
    color: var(--teal-deep);
}

.step-label {
    font-size: 0.8rem;
    text-align: center;
    color: var(--ink-soft);
    max-width: 60px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--teal-deep), oklch(0.35 0.08 195));
}

.btn-secondary {
    background: var(--line);
    color: var(--ink);
}

.btn-secondary:hover {
    background: #D0D0D0;
}

.btn-success {
    background: linear-gradient(135deg, oklch(0.68 0.10 142), oklch(0.62 0.10 142));
    color: white;
}

.btn-block {
    width: auto;
    margin: 4px auto 0;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--teal);
    color: var(--teal);
}

.btn-outline:hover {
    background: var(--teal-soft);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 32px;
}

@media (max-width: 480px) {
    .form-actions {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RODAPÉ
   ============================================ */

.registro-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--ink-soft);
}

.registro-footer a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

.registro-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   MENSAGEM "QUASE LÁ" (etapa final)
   ============================================ */

.quase-la {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--coral-soft), var(--sun-soft));
    border: 1px solid var(--coral);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    animation: pop 0.4s ease;
}

.quase-la-emoji {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
}

.quase-la strong {
    display: block;
    color: var(--teal-deep);
    font-size: 1.05rem;
    margin-bottom: 2px;
}

.quase-la span {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.btn-celebrate {
    position: relative;
    overflow: hidden;
}

.btn-celebrate span[aria-hidden] {
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-celebrate:hover span[aria-hidden] {
    transform: scale(1.25) rotate(-12deg);
}

/* ============================================
   RESUMO DE DADOS
   ============================================ */

.resumo-dados {
    background: var(--paper);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.resumo-section {
    margin-bottom: 24px;
}

.resumo-section:last-child {
    margin-bottom: 0;
}

.resumo-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--teal-deep);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--teal-soft);
    padding-bottom: 8px;
}

.data-list {
    display: grid;
    gap: 12px;
}

.data-list > div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
}

.data-list dt {
    font-weight: 600;
    color: var(--ink);
}

.data-list dd {
    color: var(--ink-soft);
    margin: 0;
}

/* ============================================
   TERMOS
   ============================================ */

.termos-section {
    background: var(--teal-soft);
    border: 1px solid var(--teal);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.termos-section h2 {
    color: var(--teal-deep);
    margin-top: 0;
}

.termos-content {
    color: var(--ink);
    line-height: 1.6;
}

.termos-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.termos-content li {
    margin-bottom: 8px;
}

.termos-note {
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-style: italic;
    margin-top: 16px;
}

.checkbox-large {
    padding: 16px;
    background: var(--paper);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.checkbox-large:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
}

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

@media (max-width: 768px) {
    .registro-wrapper {
        padding: 24px;
    }

    .registro-header h1 {
        font-size: 1.5rem;
    }

    .tipo-cards {
        grid-template-columns: 1fr;
    }

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

    .progress-bar {
        flex-wrap: wrap;
    }

    .step-label {
        display: none;
    }

    .data-list > div {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .registro-container {
        min-height: auto;
        padding: 20px 10px;
    }

    .registro-wrapper {
        padding: 20px;
        border-radius: 12px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Aceninho amistoso no emoji 👋 do cabeçalho */
@keyframes wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
}

/* Confete sutil ao concluir o cadastro (etapa 4) */
@keyframes pop {
    0% { transform: scale(0.85); opacity: 0; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

.form-control:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

/* Respeita quem prefere menos movimento na tela (WCAG 2.1 - 2.3.3) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .header-emoji {
        animation: none;
    }
}

/* ============================================
   VALIDAÇÃO DINÂMICA (JavaScript controlada)
   ============================================ */

#validacao-profissional {
    display: none;
    background: var(--paper);
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
}

#validacao-profissional.visible {
    display: block;
}

#preview-foto {
    display: none;
}

#preview-foto.visible {
    display: block;
}

#preview-logo {
    display: none;
}

#preview-logo.visible {
    display: block;
}
