/* ============================================================================
 * CREATE GOAL MODULE
 * ----------------------------------------------------------------------------
 * Formulário de criação de meta financeira, com banner estilizado, cartão de
 * imagem hero e layout responsivo (mobile-first → grid em desktop).
 *
 * Depende das seguintes variáveis globais (definidas no design system):
 *   --transition-theme, --shadow-sm, --shadow-md, --brand-primary,
 *   --brand-primary-light, --bg-card, --bg-card-secondary, --border-color,
 *   --text-primary, --text-secondary, --btn-border, --btn-hover, --font-main
 *
 * Índice:
 *   1. Container Principal & Layout
 *   2. Seção de Imagem (Hero)
 *   3. Banner de Título Estilizado
 *   4. Formulário & Controles (inputs, labels, radio group)
 *   5. Componente de Botões de Ação (compartilhado entre páginas)
 *   6. Responsividade — Formulário de Meta
 *   7. Responsividade — Botões de Ação
 * ==========================================================================*/


/* ----------------------------------------------------------------------------
 * 1. CONTAINER PRINCIPAL & LAYOUT
 * -------------------------------------------------------------------------- */
.form-container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    transition: var(--transition-theme);
}


/* ----------------------------------------------------------------------------
 * 2. SEÇÃO DE IMAGEM (HERO)
 * -------------------------------------------------------------------------- */
.form-image {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    box-shadow: var(--shadow-sm);
}

.form-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}


/* ----------------------------------------------------------------------------
 * 3. BANNER DE TÍTULO ESTILIZADO
 * -------------------------------------------------------------------------- */
.form-stylized-title {
    box-sizing: border-box;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background-color: var(--brand-primary);
    transition: var(--transition-theme);
}

.form-container .form-stylized-title p {
    margin: 0;
    padding: 0;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: right;
    text-transform: uppercase;
    color: #ffffff;
}


/* ----------------------------------------------------------------------------
 * 4. FORMULÁRIO & CONTROLES
 * -------------------------------------------------------------------------- */
.goal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    padding: 2rem 1.5rem;
    border-radius: 0 0 12px 12px;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-md);
    transition: var(--transition-theme);
}

/* Linha de campo (rótulo + input) */
.form-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
}

.form-row label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-theme);
}

.form-row input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card-secondary);
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, var(--transition-theme);
}

.form-row input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-row input:focus {
    outline: none;
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 3px rgba(165, 122, 227, 0.25);
}

/* Grupo de seleção de moeda (radio) */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    margin: 0.25rem 0 0.75rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card-secondary);
    transition: var(--transition-theme);
}

.radio-group input[type="radio"] {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid var(--brand-primary-light);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-group input[type="radio"]:checked {
    background-color: var(--brand-primary-light);
    box-shadow: inset 0 0 0 3px var(--bg-card-secondary);
}

.radio-group label {
    margin-right: 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-theme);
}

/* Divisor específico do rodapé de ações deste formulário.
    O componente de botões em si é definido de forma compartilhada
   na Seção 5, para ser reutilizado em outras páginas. */
.goal-form .actions-interface {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}


/* ----------------------------------------------------------------------------
 * 5. COMPONENTE DE BOTÕES DE AÇÃO (compartilhado entre páginas)
 * ----------------------------------------------------------------------------
 * NOTA DE REFATORAÇÃO: o arquivo original definia ".actions-interface" duas
 * vezes — uma versão local (mobile empilhado em coluna, full-width) dentro
 * do módulo do formulário, e uma versão "global" mais completa ao final do
 * arquivo, reaproveitada também por ".projects-actions". Como as duas regras
 * têm a mesma especificidade, a segunda (esta) já vencia a cascata em todos
 * os tamanhos de tela — ou seja, o layout empilhado em coluna nunca chegava
 * a ser renderizado na prática. As duas definições foram unificadas aqui em
 * um único componente, eliminando a duplicidade e mantendo o resultado
 * visual que já era efetivamente exibido.
 * -------------------------------------------------------------------------- */
.actions-interface,
.projects-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1.5rem;
}

.actions-interface a,
.actions-interface button,
.projects-actions a,
.projects-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
    width: auto;
    min-width: 140px;
    height: 46px;
    padding: 0 1.5rem;
    border-radius: 8px;
    font-family: var(--font-main, 'Space Grotesk', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variante secundária: Voltar / Cancelar */
.actions-interface .btn-secondary,
.projects-actions .btn-cancel {
    background-color: transparent;
    border: 2px solid var(--btn-border, #9ea3b0);
    color: var(--text-secondary, #4a5568);
}

.actions-interface .btn-secondary:hover,
.projects-actions .btn-cancel:hover {
    background-color: var(--btn-hover, rgba(158, 163, 176, 0.15));
    border-color: var(--btn-border, #9ea3b0);
    color: var(--text-primary, #1a1a2e);
}

/* Variante principal: Calcular / Criar Projeto */
.actions-interface .btn-primary,
.projects-actions .btn-submit {
    background-color: transparent;
    border: 2px solid var(--brand-primary-light, #a57ae3);
    color: var(--brand-primary-light, #a57ae3);
}

.actions-interface .btn-primary:hover,
.projects-actions .btn-submit:hover {
    background-color: var(--brand-primary-light, #a57ae3);
    border-color: var(--brand-primary-light, #a57ae3);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(165, 122, 227, 0.35);
}


/* ----------------------------------------------------------------------------
 * 6. RESPONSIVIDADE — FORMULÁRIO DE META
 * -------------------------------------------------------------------------- */

/* Tablet (>= 640px) --------------------------------------------------------*/
@media (min-width: 640px) {
    .goal-form {
        padding: 2.5rem;
    }

    .form-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .form-row label {
        flex: 0 0 200px;
    }

    .form-row input {
        flex: 1;
    }

    .radio-group {
        justify-content: flex-end;
    }
}

/* Desktop (>= 1024px) -------------------------------------------------------*/
@media (min-width: 1024px) {
    .form-container {
        display: grid;
        grid-template-columns: 380px 1fr;
        grid-template-rows: auto 1fr;
        align-items: stretch;
        overflow: hidden;
        margin: 4rem auto;
        border-radius: 16px;
        background-color: var(--bg-card);
        box-shadow: var(--shadow-md);
    }

    .form-image {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .form-stylized-title {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .goal-form {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        padding: 3rem;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Ultra-wide (>= 1440px) ----------------------------------------------------*/
@media (min-width: 1440px) {
    .form-container {
        max-width: 1140px;
        grid-template-columns: 440px 1fr;
    }

    .goal-form {
        padding: 3.5rem;
    }
}


/* ----------------------------------------------------------------------------
 * 7. RESPONSIVIDADE — BOTÕES DE AÇÃO
 * -------------------------------------------------------------------------- */

/* Mobile estreito (<= 480px) ------------------------------------------------*/
@media (max-width: 480px) {
    .actions-interface,
    .projects-actions {
        justify-content: space-between;
    }

    .actions-interface a,
    .actions-interface button,
    .projects-actions a,
    .projects-actions button {
        flex: 1;
        min-width: 0;
        padding: 0 0.5rem;
    }
}