/**
 * Modal de inscrição do curso (courses/partials/_course-reg-modal.blade.php)
 * Cores da marca: _variables.scss ($brand-blue, $brand-red, $color-01...)
 */

.crm-modal,
.crm-section,
.crm-card {
    --crm-blue: #1d1e46;         /* $brand-blue */
    --crm-blue-deep: #191d3d;    /* $color-01 */
    --crm-bg: #10112a;
    --crm-wine: #7d1e19;         /* $brand-red */
    --crm-red: #c8261c;          /* tom vivo para destaque (próximo ao #ce190f dos botões da página) */
    --crm-gray: #6f6f6e;
    --crm-text: #f4f5fa;
    --crm-text-soft: #b4b7cc;
    --crm-line: rgba(255, 255, 255, .14);
    --crm-line-strong: rgba(255, 255, 255, .28);
    --crm-field-bg: rgba(255, 255, 255, .035);
    --crm-error: #ff8a80;
    --crm-radius: 10px;
    --crm-ease: cubic-bezier(.22, .61, .36, 1);
    font-family: 'Raleway', sans-serif;
}

/* ===== Seção da página com o formulário embutido ===== */
.crm-section {
    margin: 0 0 25px;
    scroll-margin-top: 120px;
}
.crm-section__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--crm-blue);
}
.crm-section__desc {
    margin: 0 0 20px;
    font-size: .95rem;
    color: var(--crm-gray);
}

/* ===== Botões ===== */
.crm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 30px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: #fff;
    cursor: pointer;
    transition: transform .2s var(--crm-ease), box-shadow .2s var(--crm-ease), filter .2s;
}
.crm-btn--primary {
    background: linear-gradient(135deg, var(--crm-red) 0%, var(--crm-wine) 100%);
    box-shadow: 0 8px 22px rgba(200, 38, 28, .35);
}
.crm-btn--primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(200, 38, 28, .45); }
.crm-btn--primary:active { transform: translateY(0); }
.crm-btn[disabled] { opacity: .65; cursor: progress; transform: none; }
.crm-btn i { font-size: .9em; }

.crm-btn:focus-visible,
.crm-link:focus-visible,
.crm-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ===== Modal (Bootstrap 4) ===== */
body.crm-is-open .modal-backdrop.show {
    background: #05061a;
    opacity: .78;
}

/* Tela cheia em todos os tamanhos */
.crm-modal .crm-dialog {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
}
.crm-modal .crm-modal__content {
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: var(--crm-bg);
}
.crm-modal.fade .crm-dialog {
    transform: translateY(24px);
    opacity: 0;
    transition: transform .35s var(--crm-ease), opacity .3s var(--crm-ease);
}
.crm-modal.show .crm-dialog {
    transform: none;
    opacity: 1;
}

.crm-card {
    display: grid;
    grid-template-columns: minmax(260px, 30%) 1fr;
    overflow: hidden;
    background: var(--crm-bg);
    color: var(--crm-text);
}

/* Dentro do modal: ocupa a tela toda, conteúdo centralizado */
.crm-card.is-in-modal {
    min-height: 100vh;
    min-height: 100dvh;
}
.crm-card.is-in-modal .crm-flow {
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Embutido na página: layout compacto (cabeçalho no topo), sem botão de fechar */
.crm-card.is-embedded {
    grid-template-columns: 1fr;
    border: 1px solid var(--crm-line);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(16, 17, 42, .18);
}
.crm-card.is-embedded .crm-close { display: none; }
.crm-card.is-embedded .crm-aside { flex-direction: row; align-items: center; gap: 20px; padding: 22px 28px; }
.crm-card.is-embedded .crm-aside__body { margin: 0; }
.crm-card.is-embedded .crm-aside__title { margin: 0; font-size: 1.25rem; }
.crm-card.is-embedded .crm-aside__text,
.crm-card.is-embedded .crm-aside__art { display: none; }
.crm-card.is-embedded .crm-aside__logo { display: none; }
.crm-card.is-embedded .crm-main { padding: 36px 40px; }

/* ===== Painel lateral ===== */
.crm-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 48px 40px;
    overflow: hidden;
    background:
        radial-gradient(90% 55% at 0% 100%, rgba(200, 38, 28, .55) 0%, rgba(125, 30, 25, .35) 40%, rgba(125, 30, 25, 0) 75%),
        radial-gradient(70% 45% at 0% 0%, rgba(200, 38, 28, .35) 0%, rgba(125, 30, 25, 0) 70%),
        linear-gradient(180deg, var(--crm-blue) 0%, var(--crm-blue-deep) 100%);
}
.crm-aside::after {
    /* forma orgânica clara no rodapé */
    content: "";
    position: absolute;
    left: -30%;
    bottom: -32%;
    width: 120%;
    height: 50%;
    border-radius: 50%;
    background: rgba(16, 17, 42, .55);
    pointer-events: none;
}
.crm-aside__logo {
    position: relative;
    z-index: 1;
    width: 132px;
    height: auto;
}
.crm-aside__body {
    position: relative;
    z-index: 1;
    margin-top: 72px;
}
.crm-aside__title {
    margin: 0 0 18px;
    font-size: 1.85rem;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    animation: crm-fade-up .45s var(--crm-ease);
}
.crm-aside__title em {
    font-style: normal;
    color: #ff4a3d;
}
.crm-aside__text {
    margin: 0;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--crm-text-soft);
}
.crm-aside__text strong { color: #fff; font-weight: 600; }
.crm-aside__art {
    position: relative;
    z-index: 1;
    width: 120px;
    margin-top: auto;
    color: rgba(255, 255, 255, .7);
}
.crm-aside__check { stroke: #ff4a3d; }

/* ===== Área principal ===== */
.crm-main {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 48px 64px 40px;
    background:
        radial-gradient(60% 50% at 100% 50%, rgba(125, 30, 25, .18) 0%, rgba(125, 30, 25, 0) 70%),
        var(--crm-bg);
}
.crm-main::before {
    /* arco decorativo vinho na borda direita */
    content: "";
    position: absolute;
    top: 14%;
    right: -220px;
    width: 300px;
    height: 72%;
    border: 1px solid rgba(200, 38, 28, .35);
    border-radius: 50%;
    pointer-events: none;
}
.crm-flow { position: relative; display: flex; flex-direction: column; flex: 1; }

.crm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--crm-text-soft);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.crm-close:hover { background: rgba(255, 255, 255, .06); border-color: var(--crm-line); color: #fff; }

/* ===== Stepper ===== */
.crm-stepper {
    display: flex;
    margin: 0 0 36px;
    padding: 0;
    list-style: none;
}
.crm-stepper__item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.crm-stepper__item + .crm-stepper__item::before {
    /* linha que liga ao passo anterior */
    content: "";
    position: absolute;
    top: 14px;
    right: calc(50% + 22px);
    left: calc(-50% + 22px);
    height: 1px;
    background: var(--crm-line-strong);
    transition: background .4s var(--crm-ease);
}
.crm-stepper__item.is-active::before,
.crm-stepper__item.is-done::before {
    background: linear-gradient(90deg, var(--crm-red), rgba(200, 38, 28, .55));
}
.crm-stepper__dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--crm-line-strong);
    border-radius: 50%;
    font-size: .95rem;
    font-weight: 600;
    color: var(--crm-text-soft);
    background: var(--crm-bg);
    transition: all .35s var(--crm-ease);
}
.crm-stepper .crm-stepper__done { display: none; font-size: .7rem; }
.crm-stepper__item.is-active .crm-stepper__dot {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--crm-red), var(--crm-wine));
    box-shadow: 0 0 0 5px rgba(200, 38, 28, .18), 0 6px 18px rgba(200, 38, 28, .45);
}
.crm-stepper__item.is-done .crm-stepper__dot {
    border-color: var(--crm-red);
    color: #ff6a5e;
}
.crm-stepper .crm-stepper__item.is-done .crm-stepper__done { display: block; }
.crm-stepper__mobile { display: none; }

/* ===== Etapas ===== */
.crm-form { display: flex; flex-direction: column; flex: 1; margin: 0; }
.crm-steps { flex: 1; }

.crm-step {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.crm-step[hidden] { display: none; }
.crm-step.is-leaving-left   { animation: crm-out-left .2s var(--crm-ease) forwards; }
.crm-step.is-leaving-right  { animation: crm-out-right .2s var(--crm-ease) forwards; }
.crm-step.is-entering-right { animation: crm-in-right .32s var(--crm-ease); }
.crm-step.is-entering-left  { animation: crm-in-left .32s var(--crm-ease); }

.crm-step__title {
    float: none;
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    font-family: inherit;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}
.crm-step__title:focus { outline: none; }
.crm-step__desc {
    margin: 0 0 28px;
    font-size: 1rem;
    color: var(--crm-text-soft);
}

/* ===== Campos ===== */
.crm-field {
    position: relative;
    margin-bottom: 18px;
}
.crm-field__icon {
    position: absolute;
    top: 33px;
    left: 26px;
    transform: translateY(-50%);
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--crm-text-soft);
    pointer-events: none;
    transition: color .2s;
}
.crm-card .crm-input {
    display: block;
    width: 100%;
    height: 66px;
    margin: 0;
    padding: 0 22px 0 64px;
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    background-color: var(--crm-field-bg);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    box-shadow: none;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}
.crm-card .crm-input::placeholder { color: var(--crm-text-soft); opacity: 1; }
.crm-card .crm-input:hover { border-color: var(--crm-line-strong); }
.crm-card .crm-input:focus {
    outline: none;
    border-color: rgba(255, 74, 61, .8);
    background-color: rgba(255, 255, 255, .06);
    box-shadow: 0 0 0 4px rgba(200, 38, 28, .2);
}
.crm-field:focus-within .crm-field__icon { color: #fff; }

.crm-card .crm-select {
    padding-right: 52px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5l6 6 6-6' stroke='%23b4b7cc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 22px center;
}
.crm-card .crm-select:invalid { color: var(--crm-text-soft); }
.crm-card .crm-select option { color: #fff; background: var(--crm-blue); }
.crm-card .crm-select:disabled { opacity: .55; cursor: not-allowed; }

.crm-card .crm-input.is-invalid,
.crm-card .crm-input.is-invalid:focus {
    border-color: var(--crm-error);
    box-shadow: 0 0 0 4px rgba(255, 138, 128, .15);
}
.crm-field__error {
    display: none;
    margin: 8px 0 0 4px;
    font-size: .875rem;
    color: var(--crm-error);
}
.crm-field__error.is-visible { display: block; animation: crm-fade-up .25s var(--crm-ease); }

/* Captcha: mantém o visual original do componente, só centralizado */
.crm-captcha { margin: 6px 0 14px; }
.crm-captcha > .col-12 { padding: 0; }
.crm-captcha .captcha-widget { border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.crm-captcha.is-invalid .captcha-widget { border-color: var(--crm-error); }

/* LGPD (o partial compartilhado usa texto preto inline) */
.crm-lgpd { text-align: center; }
.crm-lgpd label { cursor: pointer; }
.crm-lgpd span { color: var(--crm-text-soft) !important; font-size: .8rem; }
.crm-lgpd input { accent-color: var(--crm-red); }

.crm-alert {
    margin-top: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 138, 128, .4);
    border-radius: 8px;
    background: rgba(200, 38, 28, .12);
    color: #ffd2cd;
    font-size: .9rem;
}
.crm-alert[hidden] { display: none; }

/* ===== Ações ===== */
.crm-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
}
.crm-actions [hidden] { display: none; }
.crm-actions .crm-btn { margin-left: auto; } /* fica à direita mesmo sem o botão Voltar */
.crm-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    font-family: inherit;
    font-size: 1rem;
    color: var(--crm-text-soft);
    cursor: pointer;
    transition: color .2s;
}
.crm-link:hover { color: #fff; }
.crm-link i { transition: transform .2s var(--crm-ease); }
.crm-link:hover i { transform: translateX(-3px); }
.crm-btn--primary:hover i.fa-arrow-right { transform: translateX(3px); }
.crm-btn i { transition: transform .2s var(--crm-ease); }

/* ===== Barra de progresso ===== */
.crm-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, .06);
}
.crm-progress__bar {
    display: block;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, var(--crm-wine), var(--crm-red));
    box-shadow: 0 0 12px rgba(200, 38, 28, .6);
    transition: width .45s var(--crm-ease);
}

.crm-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .15);
    border-top-color: var(--crm-red);
    border-radius: 50%;
    animation: crm-spin .3s linear infinite;
}

/* ===== Animações ===== */
@keyframes crm-fade-up    { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes crm-out-left   { to { opacity: 0; transform: translateX(-28px); } }
@keyframes crm-out-right  { to { opacity: 0; transform: translateX(28px); } }
@keyframes crm-in-right   { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes crm-in-left    { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes crm-spin       { to { transform: rotate(360deg); } }

/* ===== Responsivo ===== */
@media (max-width: 991.98px) {
    .crm-card { grid-template-columns: 1fr; min-height: 0; }
    .crm-aside { flex-direction: row; align-items: center; gap: 20px; padding: 22px 28px; }
    .crm-aside__body { margin: 0; }
    .crm-aside__title { margin: 0; font-size: 1.25rem; }
    .crm-aside__text, .crm-aside__art { display: none; }
    .crm-aside__logo { width: 100px; }
    .crm-main { padding: 36px 40px 36px; }
}

@media (max-width: 575.98px) {
    .crm-aside { display: none; }
    .crm-main { padding: 60px 20px 24px; }
    .crm-card.is-embedded .crm-main { padding: 28px 20px 24px; }
    .crm-close { top: 10px; right: 10px; }

    .crm-stepper { margin-bottom: 10px; }
    .crm-stepper__dot { width: 22px; height: 22px; font-size: .85rem; }
    .crm-stepper__item + .crm-stepper__item::before { top: 11px; right: calc(50% + 17px); left: calc(-50% + 17px); }
    .crm-stepper__mobile { display: block; margin: 0 0 26px; text-align: center; font-size: .85rem; color: var(--crm-text-soft); }

    .crm-step__title { font-size: 1.6rem; }
    .crm-step__desc { margin-bottom: 22px; font-size: .95rem; }
    .crm-card .crm-input { height: 58px; padding-left: 56px; font-size: 1rem; }
    .crm-field__icon { top: 29px; left: 22px; }

    /* botões sempre ao alcance do polegar */
    .crm-actions {
        position: sticky;
        bottom: 0;
        margin: 24px -20px -24px;
        padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(16, 17, 42, 0) 0%, var(--crm-bg) 30%);
    }
    .crm-actions .crm-btn { flex: 1; padding: 0 20px; }

    /* embutido na página os botões ficam no fluxo normal */
    .crm-card.is-embedded .crm-actions { position: static; margin: 24px 0 0; padding: 0; background: none; }
}

@media (prefers-reduced-motion: reduce) {
    .crm-modal.fade .crm-dialog,
    .crm-modal *,
    .crm-card * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
    }
    .crm-modal.fade .crm-dialog { transform: none; }
}

