/* ==========================================================================
   Form Builder — Custom Styles
   ========================================================================== */

:root {
    --form-bg: #f0f2f5;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    --header-bg: #0d6efd; /* Primary base color */
    --text-primary: #1e293b;
    --radius: 12px;
    --transition: all 0.2s ease;
}

/* === Base === */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--form-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Page Wrapper === */
.form-page-wrapper {
    min-height: auto;
    padding: 2rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

@media (min-width: 768px) {
    .form-page-wrapper {
        padding: 3rem 1rem;
    }
}

/* === Card Layout === */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    /* //box-shadow: var(--card-shadow); */
    overflow: hidden;
    transition: var(--transition);
    width: 100%;
}


.form-card-header {
    padding: 2rem 2rem 1.75rem;
    position: relative;
    overflow: hidden;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .form-title {
        font-size: 1.75rem;
    }
}

.form-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    margin: 0.5rem 0 0;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.form-card-body {
    padding: 2rem;
}

@media (max-width: 575.98px) {
    .form-card-body {
        padding: 1.25rem;
    }
}

/* === Color Radio Swatches === */
.color-radio-label {
    cursor: pointer;
    display: inline-block;
}

.color-radio-swatch {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.color-radio-input:checked + .color-radio-swatch {
    border-color: var(--header-bg);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-radio-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* === Signature Canvas === */
.signature-wrapper {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    background: #ffffff;
    transition: var(--transition);
}

.signature-wrapper:hover {
    border-color: #cbd5e1;
}

.signature-wrapper.active {
    border-color: var(--header-bg);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.signature-canvas {
    width: 100%;
    height: 180px;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

@media (min-width: 768px) {
    .signature-canvas {
        height: 200px;
    }
}

/* === Field Groups === */
.field-group {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

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

.field-group:nth-child(1) { animation-delay: 0.05s; }
.field-group:nth-child(2) { animation-delay: 0.1s; }
.field-group:nth-child(3) { animation-delay: 0.15s; }
.field-group:nth-child(4) { animation-delay: 0.2s; }
.field-group:nth-child(5) { animation-delay: 0.25s; }
.field-group:nth-child(6) { animation-delay: 0.3s; }
.field-group:nth-child(7) { animation-delay: 0.35s; }
.field-group:nth-child(8) { animation-delay: 0.4s; }
.field-group:nth-child(9) { animation-delay: 0.45s; }
.field-group:nth-child(10) { animation-delay: 0.5s; }
.field-group:nth-child(n+11) { animation-delay: 0.55s; }

/* === Form Actions === */
.form-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
    text-align: right;
}

/* === Responsive Actions === */
@media (max-width: 575.98px) {
    .form-actions {
        text-align: center;
    }
    .btn-submit {
        width: 100%;
    }
}
