/* =====================================================
   Sistema de Inscrição - Congresso CONASEMS
   Layout baseado no front Next.js original
   ===================================================== */

/* ---- Reset & Base ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;600;700&display=swap');

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans', sans-serif;
    color: #35373b;
    background-color: #fff;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ---- Container ---- */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 1024px) { .container { max-width: 900px; padding: 0; } }
@media (min-width: 1200px) { .container { max-width: 1080px; } }
@media (min-width: 1440px) { .container { max-width: 1200px; } }

/* ---- Header / Navbar ---- */
.navbar {
    border-bottom: 1px solid #ACACAC;
    padding: 12px 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}
@media (min-width: 1024px) { .navbar { padding: 16px 0; } }

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar__logo img {
    width: 128px;
    height: 37px;
}
@media (min-width: 1024px) {
    .navbar__logo img { width: 220px; height: 63px; }
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar__links a {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #35373b;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s;
    display: none;
}
@media (min-width: 1024px) { .navbar__links a { display: block; } }
.navbar__links a:hover,
.navbar__links a.active { border-color: #4A733C; }

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding: 40px 0 96px;
}

/* ---- Section Header ---- */
.inscription-header h1 {
    margin-bottom: 8px;
    font-weight: 600;
    color: #4A733C;
    font-size: 1.5rem;
}
@media (min-width: 768px) { .inscription-header h1 { font-size: 2rem; } }

.inscription-header .subtitle {
    font-size: 1rem;
    margin-bottom: 32px;
    color: #35373b;
}
@media (min-width: 768px) { .inscription-header .subtitle { margin-bottom: 48px; font-size: 1.125rem; } }

/* ---- Stepper ---- */
.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 32px;
    gap: 0;
}

.stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 180px;
}

.stepper__circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #C4C4C4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #979797;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.stepper__step.done .stepper__circle {
    border-color: #3E9E81;
    background: #3E9E81;
    color: #fff;
}

.stepper__step.active .stepper__circle {
    border-color: #084B46;
    background: #084B46;
    color: #fff;
}

.stepper__label {
    margin-top: 8px;
    font-size: 0.75rem;
    text-align: center;
    color: #979797;
    font-weight: 400;
    transition: color 0.3s;
}
@media (min-width: 768px) { .stepper__label { font-size: 0.875rem; } }

.stepper__step.done .stepper__label { color: #3E9E81; font-weight: 600; }
.stepper__step.active .stepper__label { color: #084B46; font-weight: 600; }

.stepper__connector {
    height: 3px;
    background: #C4C4C4;
    flex: 1;
    margin-top: 24px;
    min-width: 30px;
}

.stepper__step.done ~ .stepper__connector,
.stepper__connector.done {
    background: #C4C4C4;
}

/* ---- Form Styling ---- */
.form-section {
    margin-bottom: 32px;
}

.form-section__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #35373b;
}
@media (min-width: 768px) { .form-section__title { font-size: 1.25rem; } }

.form-section__subtitle {
    font-size: 0.875rem;
    color: #7E7E7E;
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.form-group--full { flex-basis: 100%; min-width: 100%; }
.form-group--half { flex-basis: calc(50% - 8px); min-width: 200px; }
.form-group--third { flex-basis: calc(33.333% - 11px); min-width: 150px; }
.form-group--quarter { flex-basis: calc(25% - 12px); min-width: 120px; }

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #35373b;
}

.form-group label .required {
    color: #E73920;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #CBD4D8;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: 'Noto Sans', sans-serif;
    color: #35373b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
@media (min-width: 768px) {
    .form-group input,
    .form-group select { font-size: 1rem; padding: 14px 16px; }
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3E9E81;
    box-shadow: 0 0 0 3px rgba(62, 158, 129, 0.15);
}

.form-group input.error,
.form-group select.error {
    border-color: #E73920;
    box-shadow: 0 0 0 3px rgba(231, 57, 32, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #F6F6F6;
    color: #979797;
    cursor: not-allowed;
}

.form-group .error-text {
    font-size: 0.75rem;
    color: #E73920;
    margin-top: 4px;
    display: none;
}

.form-group .error-text.visible { display: block; }

.form-group .char-count {
    font-size: 0.75rem;
    color: #979797;
    text-align: right;
    margin-top: 4px;
}

/* ---- Checkboxes & Radios ---- */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #3E9E81;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label,
.radio-group label {
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
}
@media (min-width: 768px) {
    .checkbox-group label,
    .radio-group label { font-size: 1rem; }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Noto Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    gap: 8px;
}
@media (min-width: 768px) { .btn { font-size: 1.125rem; padding: 12px 24px; } }

.btn:disabled {
    background: #D8DFE2 !important;
    color: #979797 !important;
    border-color: #D8DFE2 !important;
    cursor: not-allowed;
}

.btn-primary {
    background: #3E9E81;
    color: #fff;
    border: 1px solid #3E9E81;
}
.btn-primary:hover:not(:disabled) { background: #4ABE9B; }
.btn-primary:active:not(:disabled) { background: #084B46; }

.btn-outlined {
    background: transparent;
    color: #3E9E81;
    border: 1px solid #3E9E81;
}
.btn-outlined:hover:not(:disabled) { background: #f0faf6; }

.btn-danger {
    background: #E73920;
    color: #fff;
}

/* ---- Card de Descontos/Resumo ---- */
.card-resumo {
    background: #F0F6F3;
    border: 1px solid #D8DFE2;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.card-resumo__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.875rem;
}
@media (min-width: 768px) { .card-resumo__row { font-size: 1rem; } }

.card-resumo__row--total {
    border-top: 2px solid #CBD4D8;
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 1rem;
}
@media (min-width: 768px) { .card-resumo__row--total { font-size: 1.125rem; } }

.card-resumo__label { color: #7E7E7E; }
.card-resumo__value { font-weight: 600; }
.card-resumo__value--discount { color: #3E9E81; }

/* ---- Cupom Section ---- */
.cupom-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}
@media (min-width: 768px) { .cupom-section { flex-direction: row; align-items: flex-end; } }

.cupom-section .form-group { flex: 1; }
.cupom-section .btn { height: 50px; white-space: nowrap; }
@media (min-width: 768px) { .cupom-section .btn { height: 56px; } }

/* ---- Aguardando Pagamento ---- */
.payment-info {
    background: #F0F6F3;
    border-radius: 10px;
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.payment-info__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #084B46;
    margin-bottom: 16px;
}

.payment-info__detail {
    font-size: 0.875rem;
    color: #35373b;
    margin-bottom: 8px;
    word-break: break-all;
}

.payment-info .copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3E9E81;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 16px;
    transition: background 0.3s;
}
.payment-info .copy-btn:hover { background: #4ABE9B; }

/* ---- Confirmation ---- */
.confirmation-box {
    text-align: center;
    padding: 48px 24px;
}

.confirmation-box__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #3E9E81;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 24px;
}

.confirmation-box__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #084B46;
    margin-bottom: 16px;
}
@media (min-width: 768px) { .confirmation-box__title { font-size: 2rem; } }

.confirmation-box__text {
    font-size: 1rem;
    color: #7E7E7E;
    margin-bottom: 8px;
}

/* ---- Buttons Row ---- */
.buttons-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
    flex-wrap: wrap;
}

/* ---- Loading Spinner ---- */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease infinite;
}

.spinner--dark {
    border-color: rgba(62, 158, 129, 0.2);
    border-top-color: #3E9E81;
}

.spinner--large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

/* ---- Notifications ---- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    cursor: pointer;
}

.notification--success { background: #3E9E81; }
.notification--error { background: #E73920; }
.notification--warning { background: #FCBE12; color: #35373b; }

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

/* ---- Footer ---- */
.footer {
    background: #084B46;
    color: #fff;
    padding: 32px 0;
    text-align: center;
}

.footer p {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

.footer a { color: #4ABE9B; }

/* ---- Steps visibility ---- */
.step { display: none; }
.step.active { display: block; animation: fadeIn 0.4s ease; }

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

/* ---- Responsivo mobile ---- */
@media (max-width: 767px) {
    .form-group--half,
    .form-group--third,
    .form-group--quarter {
        flex-basis: 100%;
        min-width: 100%;
    }

    .stepper__circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .stepper__connector { margin-top: 20px; }

    .buttons-row { flex-direction: column; align-items: stretch; }
    .buttons-row .btn { width: 100%; }
}

/* ---- QR Code ---- */
.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px 0;
}

.qrcode-container canvas,
.qrcode-container img {
    max-width: 250px;
    border: 4px solid #f0f0f0;
    border-radius: 12px;
}

/* ---- Terms ---- */
.terms-container {
    background: #F6F6F6;
    border: 1px solid #E1E1E1;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #7E7E7E;
}

/* ---- Hidden ---- */
.hidden { display: none !important; }

/* ---- PIX copy text ---- */
.pix-code-text {
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 16px;
    word-break: break-all;
    font-size: 0.75rem;
    color: #35373b;
    margin: 16px 0;
    max-height: 120px;
    overflow-y: auto;
}

/* =====================================================
   LOGIN SCREEN
   ===================================================== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    padding: 40px 16px;
}

.login-screen__content {
    text-align: center;
    max-width: 480px;
    width: 100%;
    padding: 48px 32px;
    border-radius: 16px;
    background: linear-gradient(135deg, #F0F6F3 0%, #fff 50%, #F0F6F3 100%);
    border: 1px solid #D8DFE2;
    box-shadow: 0 8px 32px rgba(8, 75, 70, 0.08);
}

.login-screen__icon {
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.login-screen__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #084B46;
    margin-bottom: 12px;
}
@media (min-width: 768px) { .login-screen__title { font-size: 1.75rem; } }

.login-screen__text {
    font-size: 0.9375rem;
    color: #7E7E7E;
    margin-bottom: 32px;
    line-height: 1.6;
}

.login-screen__btn {
    width: 100%;
    max-width: 320px;
    padding: 14px 24px;
    font-size: 1.0625rem;
    margin-bottom: 20px;
}

.login-screen__subtext {
    font-size: 0.8125rem;
    color: #979797;
}

.login-screen__link {
    color: #3E9E81;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}
.login-screen__link:hover { color: #084B46; }


/* =====================================================
   REGISTRATION TOGGLE (Inscrição de outra pessoa)
   ===================================================== */
.registration-toggle {
    margin-bottom: 24px;
}

.registration-toggle__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 10px;
    background: #E6F9F0;
    border: 1px solid #B8E6D4;
    transition: all 0.3s ease;
}

.registration-toggle__content--other {
    background: #EBF3FE;
    border-color: #B3D4FC;
}

.registration-toggle__text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: #35373b;
    line-height: 1.5;
}
@media (min-width: 768px) { .registration-toggle__text { font-size: 0.9375rem; } }

.registration-toggle__btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.8125rem !important;
    padding: 8px 16px !important;
}

@media (max-width: 767px) {
    .registration-toggle__content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .registration-toggle__btn { width: 100%; }
}


/* =====================================================
   HEALTH SECRETARY TAG
   ===================================================== */
.health-secretary-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #E6F9F0, #D4F0E4);
    border: 1px solid #3E9E81;
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}

.health-secretary-tag__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.health-secretary-tag__text {
    font-weight: 700;
    font-size: 0.875rem;
    color: #084B46;
}

.health-secretary-tag__location {
    font-size: 0.8125rem;
    color: #3E9E81;
    font-weight: 500;
}


/* =====================================================
   NAVBAR USER
   ===================================================== */
.navbar__user {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #084B46;
    background: #E6F9F0;
    padding: 6px 14px;
    border-radius: 20px;
    display: none;
}
@media (min-width: 1024px) { .navbar__user { display: inline-block; } }


/* =====================================================
   INPUT WITH ICON
   ===================================================== */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 1px solid #CBD4D8;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: 'Noto Sans', sans-serif;
    color: #35373b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
@media (min-width: 768px) {
    .input-with-icon input { font-size: 1rem; padding: 14px 16px; padding-right: 44px; }
}

.input-with-icon input:focus {
    border-color: #3E9E81;
    box-shadow: 0 0 0 3px rgba(62, 158, 129, 0.15);
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    line-height: 0;
}


/* =====================================================
   HELPER TEXT
   ===================================================== */
.helper-text {
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 18px;
    transition: color 0.2s;
}

.helper-text--success { color: #4A733C; font-weight: 600; }
.helper-text--error { color: #E73920; font-weight: 600; }


/* =====================================================
   MODAL DE LOGIN (iframe)
   ===================================================== */
.signin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2900;
    width: 100%;
    height: 100vh;
}

.signin-modal-container {
    position: fixed;
    display: flex;
    inset: 0;
    pointer-events: none;
    z-index: 3000;
    width: 100%;
    height: 100vh;
    justify-content: center;
    align-items: center;
}

.signin-modal-content {
    position: relative;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    pointer-events: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.signin-modal-iframe {
    width: 320px;
    height: min(736px, 90vh);
    border: none;
    display: block;
}
@media (min-width: 768px) {
    .signin-modal-iframe {
        width: 480px;
    }
}

.signin-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #35373b;
    transition: color 0.2s;
    z-index: 1;
}
.signin-modal-close:hover {
    color: #E73920;
}
