* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --purple: #7c3aed;
    --purple-dark: #5b21b6;
    --purple-deep: #2a2cb8;
    --purple-mid: #4f46e5;
    --purple-light: #ad91fb;
    --purple-pale: #d9d3ff;
    --purple-ghost: #f0eeff;
    --white: #ffffff;
    --bg: #f8f7fc;
    --text: #1e1b2e;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e9e4f8;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(124, 58, 237, .08);
    --shadow-md: 0 8px 32px rgba(124, 58, 237, .14);
    --transition: 0.2s ease;
}

body {
    position: relative;
    font-family: 'Poppins', sans-serif;
    background-color: #fbfafd;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

.form-top {
    margin-bottom: 36px;
}

.back-link {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--purple);
}

.back-link .material-icons-round {
    font-size: 20px;
}

.home-corner-link {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--purple-mid);
    border-radius: 50%;
    border: 1px solid var(--border);
    box-shadow: 0 12px 22px rgba(124, 58, 237, .14);
    text-decoration: none;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.home-corner-link:hover {
    transform: translateY(-1px);
    background: #f8f5ff;
    box-shadow: 0 16px 28px rgba(124, 58, 237, .18);
}

.home-corner-link .material-icons-round {
    font-size: 20px;
}

/* FORM + OPTIONAL SECTION UNIFIED */
.form-section,
.optional-section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 25px auto;
    padding: 2rem;
    border-radius: 12px;
    background: #fbfafd;
}

/* DIVIDING LINE */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 2px solid #bfbce5;
}

.divider span {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 0 15px;
    font-weight: bold;
    color: #9c96d1;
}

.socials {
    margin: 70px 0 30px 0;
}

.contact {
    margin: 50px 0 30px 0;
}

.profile {
    margin: 50px 0 30px 0;
}

/* HEADINGS */
h2 {
    font-family: 'Poppins', sans-serif;
    margin-top: 1rem;
    margin-bottom: 0.2rem;
    color: #000000;
}

p {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 1.5rem;
    color: #9d99b9;
}

/* ─── STEP BAR (improved) ─────────────────────────────── */
.step-bar-wrapper {
    margin-bottom: 2rem;
}

.step-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.step-bar span {
    height: 5px;
    border-radius: 999px;
    flex: 1;
    background: #e0ddf7;
    transition: background 0.3s ease;
}

.step-bar span.active {
    background: var(--purple-mid);
}

.step-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.step-label {
    font-size: 0.72rem;
    color: #c0bbdf;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 1;
    text-align: center;
    transition: color 0.3s;
}

.step-label:first-child { text-align: left; }
.step-label:last-child  { text-align: right; }

.step-label.active {
    color: #7546db;
}

/* ─── ENGAGEMENT TYPE SELECTOR ────────────────────────── */
.engagement-selector {
    margin: 1.5rem 0 2rem 0;
}

.engagement-selector h3 {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #9d99b9;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.engagement-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.engagement-card {
    position: relative;
    cursor: pointer;
    border-radius: 14px;
    padding: 1.2rem 1rem;
    border: 2.5px solid #e0ddf7;
    background: #ffffff;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    user-select: none;
}

.engagement-card:hover {
    border-color: #a79af8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(117, 70, 219, 0.1);
}

.engagement-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.engagement-card .card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    display: block;
}

.engagement-card .card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4a3f8f;
    display: block;
    margin-bottom: 0.2rem;
}

.engagement-card .card-desc {
    font-size: 0.75rem;
    color: #b0aad5;
    line-height: 1.4;
}

.engagement-card.selected {
    border-color: var(--purple-mid);
    background: linear-gradient(135deg, #f5f2ff, #ede8ff);
    box-shadow: 0 6px 24px rgba(117, 70, 219, 0.18);
}

.engagement-card.selected .card-title {
    color: #5a35c8;
}

/* ─── HIDDEN FORM CONTENT ─────────────────────────────── */
#mainFormContent {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── ENGAGEMENT EXTRA FIELDS ─────────────────────────── */
.engagement-fields {
    display: none;
}

.engagement-fields.visible {
    display: contents;
}

/* GRID FIX */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    width: 100%;
    align-items: start;
}

/* LABEL */
label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
    color: #9d99b9;
}

/* INPUT */
input {
    color: #523eaa;
    font-family: 'Poppins', sans-serif;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: #6c65f1;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

input[type="file"] {
    display: none;
}

/* LINK ROW */
.link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.link-row .form-control {
    flex: 1;
    min-width: 0;
    margin: 0;
}

/* JOB */
.job-row {
    display: grid;
    grid-template-columns: 1fr 120px 30px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.add-job-btn,
.add-link-btn {
    margin-top: 10px;
    background: none;
    border: #cac5ee dashed 2px;
    color: #917fc4;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
}

.add-job-btn:hover,
.add-link-btn:hover {
    background: #f5f3ff;
}

.remove-job,
.remove-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #ffe5e5;
    color: #e53e3e;
    border-radius: 50%;
    cursor: pointer;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    line-height: 1;
    margin-top: 0;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.remove-job:hover,
.remove-link:hover {
    background: #fecaca;
    color: #c53030;
    transform: none;
    opacity: 1;
}

.form-control,
select {
    width: 100%;
    padding: 10px;
    border: 2px solid #d9d3ff;
    border-radius: 15px;
    font-size: 1rem;
    background-color: white;
    margin-top: 0;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239d99b9' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
    margin: 5px;
}

.form-control:focus,
select:focus {
    outline: none;
    border-color: #6c65ee;
    box-shadow: 0 0 0 3px rgba(117, 70, 219, 0.15);
}

select[multiple] {
    appearance: none;
    height: auto;
    padding: 10px;
    background-image: none;
}

select[multiple] option {
    padding: 6px 8px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
}

select[multiple] option:checked {
    font-weight: bold;
    background: linear-gradient(135deg, #dfd8ff, #dfd8ff);
    color: #7369e0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0; 
}

.form-group small {
    color: #8f82e0;
}

/* CUSTOM SELECT */
.custom-select {
    position: relative;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.custom-select-selected {
    width: 100%;
    padding: 10px 36px 10px 10px;
    border: 2px solid #d9d3ff;
    border-radius: 15px;
    background: white;
    color: #9d99b9;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239d99b9' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.custom-select-selected.active {
    border-color: #6c65ee;
    box-shadow: 0 0 0 3px rgba(117, 70, 219, 0.15);
}

.custom-select-selected.selected-value {
    color: #523eaa;
}

.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #d9d3ff;
    border-radius: 12px;
    overflow: hidden;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(42, 44, 184, 0.12);
}

.custom-select-options.open {
    display: block;
}

.custom-option {
    padding: 10px 14px;
    cursor: pointer;
    color: #9d99b9;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.custom-option:hover {
    background: #f0eeff;
    color: #2a2cb8;
}

.custom-option.chosen {
    background: #d9d3ff;
    color: #2a2cb8;
    font-weight: 600;
}

/* COUNTRY CODE AND PHONE NUMBER */
.phone-input-wrap {
    display: flex;
    align-items: stretch;
    border: 2px solid #d9d3ff;
    border-radius: 15px;
    overflow: visible;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.phone-input-wrap:focus-within {
    border-color: #6c65ee;
    box-shadow: 0 0 0 3px rgba(117, 70, 219, 0.15);
}

/* Country code custom-select inside phone wrap */
.country-code-custom {
    flex-shrink: 0;
    width: auto !important;
    position: relative;
}

.country-code-custom .custom-select-selected {
    border: none !important;
    border-right: 2px solid #d9d3ff !important;
    border-radius: 13px 0 0 13px !important;
    box-shadow: none !important;
    padding: 10px 32px 10px 12px;
    white-space: nowrap;
    font-size: 0.88rem;
    background-color: #f9f7ff;
    color: #523eaa;
}

.country-code-custom .custom-select-selected.active {
    border-right-color: #6c65ee !important;
    box-shadow: none !important;
}

.country-code-custom .custom-select-options {
    min-width: 140px;
    right: auto;
    z-index: 100;
}


.phone-number-input {
    border: none !important;
    border-radius: 0 13px 13px 0 !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
    padding-left: 12px;
}

.phone-number-input:focus {
    outline: none;
    box-shadow: none !important;
}

/* PLATFORM LIST */
.platform-list,
.language-list,
.niche-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: white;
    border: 2px solid #d9d3ff;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    padding: 10px;
}

.platform-item,
.language-item,
.niche-item {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.platform-handle,
.other-platform-section {
    display: none;
    margin: 10px;
    width: auto;
}

.platform-handle,
.other-platform-section input {
    margin-top: 5px;
    margin: 5px;
}

.other-platform-section {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.platform-two-col input{
    margin: 5px;
}

/* AGREEMENT */
.agreement-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 14px;
}

.agreement-container a {
    color: #7d59e6;
}

.agreement-container a:hover {
    color: #2a2cb8;
}

/* BUTTON */
button {
    background: linear-gradient(135deg, #4f46e5, #ad91fb);
    color: white;
    font-family: 'Poppins', sans-serif;
    padding: 15px;
    padding-left: 20px;
    padding-right: 20px;
    border: none;
    margin-top: 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

button:hover {
    transform: scale(1.03);
    opacity: 0.8;
}

button:active {
    transform: scale(0.98);
}

/* PLACEHOLDER */
.form-control::placeholder {
    color: #c9c6dd;
}

/* OPTION TEXT */
option {
    color: #9d99b9;
}

/* RATE RANGE */
.rate-range{
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-range input{
    width: 180px;
    padding: 8px;
}

.rate-range span {
    color: #9d99b9;
}

/* DUPLICATION HIGHLIGHT */
.duplicate-highlight {
    border: 2px solid #fc6a6a !important;
    background: #ffe5e5;
    animation: shake 0.35s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.error-text {
    color: red;
    font-size: 12px;
    margin-top: -2px;
    margin-bottom: 12px;
}

/* LINK VALIDATION CHECKER */
.link-error-slot {
    width: 100%;
    min-height: 0;
    margin-top: 4px;
    margin-bottom: 2px;
}

.link-error-slot .error-text {
    font-size: 0.78rem;
    color: #dc2626;
    padding: 4px 8px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    border-radius: 0 4px 4px 0;
    margin-top: 2px;
    line-height: 1.45;
}

.link-error-slot .error-text.link-ok {
    color: #15803d;
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.link-error-slot .error-text code {
    background: rgba(0, 0, 0, .06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.75rem;
    word-break: break-all;
}

.example-url {
    font-family: monospace;
    font-size: 0.78rem;
    color: #7c3aed;
    background: #f3f0ff;
    padding: 1px 5px;
    border-radius: 3px;
}

/* ─── MOBILE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .form-section,
    .optional-section {
        padding: 1.2rem;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .engagement-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .engagement-card {
        padding: 1rem;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 12px;
    }

    .engagement-card .card-icon {
        font-size: 1.4rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .engagement-card .card-info {
        flex: 1;
    }

    .rate-range {
        flex-direction: column;
        align-items: stretch;
    }

    .rate-range input {
        width: 100%;
    }

    .rate-range span {
        text-align: center;
    }

    h2 {
        font-size: 1.3rem;
    }

    .step-label {
        font-size: 9px;
    }

    .pw-input {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .form-section,
    .optional-section {
        padding: 1rem;
        border-radius: 10px;
    }

    button {
        width: 100%;
        text-align: center;
    }

    .platform-two-col {
        display: flex;
        flex-direction: column;
    }

    .pw-input {
        font-size: 0.88rem;
        padding: 11px 44px 11px 14px;
    }

    label {
        font-size: 12px;
    }
    
    .divider span {
        font-size: 14px;
    }
}