:root {
    --primary-color: #000000;
    --primary-hover: #333333;
    --secondary-color: #F7f7f7;
    --secondary-hover: #EBEBEB;
    --accent-color: #D4B098; /* Subtle earthy accent for Caesarstone */
    --text-main: #1D1D1B;
    --text-light: #6b6b6b;
    --error-color: #d32f2f;
    --success-color: #2e7d32;
    --border-color: #E2E8F0;
    --bg-color: #F8FAFC;
    --box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.wizard-container {
    background: #FFFFFF;
    width: 100%;
    max-width: 1000px;
    min-height: 750px; /* Force consistent height across all steps to kill vertical jumping */
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    padding: 50px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.wizard-header {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    max-width: 180px;
    margin-bottom: 20px;
}

.wizard-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.wizard-header p {
    color: var(--text-light);
    font-size: 15px;
}

/* Progress Bar - Custom Image Design */
.progress-container {
    margin-bottom: 50px;
    position: relative;
    width: 100%;
}

.progress-indicator {
    display: flex;
    justify-content: space-between;
    list-style: none;
    position: relative;
    z-index: 2;
    padding: 0;
    margin: 0;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    position: relative;
    transition: var(--transition);
}

/* Base Grey Circle for all steps */
.step::before {
    content: '';
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-bottom: 12px;
    position: relative; /* REQUIRED for z-index to work against absolute line */
    z-index: 2;
    transition: var(--transition);
    box-sizing: border-box;
}

/* Grey connecting line connecting all steps */
.step:not(:first-child)::after {
    content: '';
    position: absolute;
    top: 13px; /* halfway down the 28px circle */
    left: -50%;
    width: 100%;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
    transition: var(--transition);
}

/* Active State */
.step.active {
    color: var(--text-main);
    font-weight: 600;
}
.step.active::before {
    border-color: #000000; /* Requested Black */
    background-color: #fff; /* Solid white backdrop */
    /* Razor-sharp vector dot */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5.5' fill='%23000000'/%3E%3C/svg%3E");
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(0, 0, 0, 0.2);
}

/* Completed State connecting line turns Green */
.step.active:not(:first-child)::after, 
.step.completed:not(:first-child)::after {
    background-color: var(--success-color);
}

/* Completed State */
.step.completed {
    color: var(--text-main);
}
.step.completed::before {
    border-color: var(--success-color);
    background-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 65%;
    background-position: center;
    background-repeat: no-repeat;
}

.progress-bar-bg {
    background-color: var(--border-color);
    height: 4px;
    border-radius: 10px;
    position: absolute;
    top: 14px;
    left: 12%;
    right: 12%;
    z-index: 1;
}

.progress-bar {
    background-color: var(--success-color);
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.4s ease-in-out;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.form-step.step-active {
    display: block;
}

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

h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-main);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.required {
    color: var(--error-color);
}

.field-desc {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
    margin-top: -4px;
}

/* Inputs & Textareas */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition);
    background-color: #fff;
    appearance: none;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

input.error,
textarea.error,
select.error {
    border-color: var(--error-color);
    background-color: #fffafb;
}

.error-text {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* Custom Radios & Checkboxes */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group.inline, .checkbox-group.inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.list-group {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.list-group .custom-radio {
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    padding: 12px 16px;
    transition: background-color 0.2s;
}

.list-group .custom-radio:last-child {
    border-bottom: none;
}

.list-group .custom-radio:hover {
    background-color: #f1f5f9;
}

.grid-select {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.custom-radio, .custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    user-select: none;
}

.custom-radio input, .custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-radio span, .custom-checkbox span {
    position: relative;
    padding-left: 30px;
    display: inline-block;
}

.custom-radio span:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: #fff;
    transition: var(--transition);
}

.custom-checkbox span:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    transition: var(--transition);
}

.custom-radio input:checked ~ span:before,
.custom-checkbox input:checked ~ span:before {
    border-color: var(--primary-color);
}

.custom-radio input:checked ~ span:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: zoomIn 0.2s;
}

.custom-checkbox input:checked ~ span:after {
    content: '';
    position: absolute;
    left: 7px;
    top: 48%;
    transform: translateY(-50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid var(--primary-color);
    border-width: 0 2px 2px 0;
    animation: zoomIn 0.2s;
}

@keyframes zoomIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.5); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* File Upload */
.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 30px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background-color: #f8fafc;
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
}

.file-drop-area:hover, .file-drop-area.is-active {
    border-color: #000000;
    background-color: #f1f5f9;
}

.fake-btn {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.file-msg {
    font-size: 13px;
    color: var(--text-light);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    opacity: 0;
}

.file-list {
    list-style: none;
    margin-top: 15px;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-remove {
    color: var(--error-color);
    cursor: pointer;
    font-weight: 600;
    padding: 0 5px;
}

/* Conditional Wrappers */
.conditional-wrapper {
    display: none;
    padding: 20px;
    margin-top: 10px;
    background-color: #fafafa;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    margin-bottom: 25px;
    animation: fadeIn 0.3s;
}

.separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

/* Buttons */
.step-actions {
    display: flex;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.step-actions.right {
    justify-content: flex-end;
}

.step-actions.between {
    justify-content: space-between;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

/* Success State */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--success-color);
    color: white;
    font-size: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.success-message h2 {
    border: none;
}

.console-note {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 15px;
    margin-bottom: 30px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-container {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .step {
        font-size: 11px;
    }
}

/* SSO Overlay Styles */
.sso-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.sso-modal {
    background: #ffffff;
    padding: 50px 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
    border-radius: 12px;
    margin-top: -10vh;
    text-align: center;
}

.sso-logo {
    display: inline-block;
    max-width: 220px;
    margin-bottom: 30px;
}

.sso-modal h2 {
    font-size: 24px;
    margin-bottom: 5px;
    border: none;
    padding: 0;
}

.sso-modal p {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 15px;
}

.sso-modal input {
    margin-bottom: 25px;
}

.sso-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sso-actions a {
    color: #0067b8;
    text-decoration: none;
    font-size: 13px;
}

.sso-actions a:hover {
    text-decoration: underline;
}

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


/* ==========================================================================
   Rich text editor (Requirement Description)
   Salesforce Rich Text Area fields render HTML, so the description is
   authored and submitted as HTML instead of plain text.
   ========================================================================== */

.cs-rte {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    transition: var(--transition);
    overflow: hidden;
}

.cs-rte.is-focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.cs-rte.error {
    border-color: var(--error-color);
    background-color: #fffafb;
}

.cs-rte-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    background: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
}

.cs-rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 28px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.cs-rte-btn:hover {
    background: #fff;
    border-color: var(--border-color);
}

.cs-rte-btn:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.cs-rte-btn.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.cs-rte-btn svg {
    display: block;
}

.cs-rte-sep {
    width: 1px;
    height: 18px;
    margin: 0 5px;
    background: var(--border-color);
}

.cs-rte-content {
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    outline: none;
    word-break: break-word;
}

.cs-rte-content.is-empty::before {
    content: attr(data-placeholder);
    display: block;
    color: var(--text-light);
    pointer-events: none;
}

.cs-rte-content p {
    margin: 0 0 10px;
}

.cs-rte-content p:last-child {
    margin-bottom: 0;
}

.cs-rte-content ul,
.cs-rte-content ol {
    margin: 0 0 10px;
    padding-inline-start: 24px;
}

.cs-rte-content li {
    margin-bottom: 4px;
}

.cs-rte-content b,
.cs-rte-content strong {
    font-weight: 600;
}

.cs-rte-hint {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
}

/* Hidden mirror field: carries the HTML into FormData and keeps the existing
   [required] validation working. Kept in the layout (not display:none) so it
   stays focusable. */
.cs-rte-mirror {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Formatted description inside the review step */
.review-rte {
    white-space: normal;
}

.review-rte p {
    margin: 0 0 6px;
}

.review-rte p:last-child {
    margin-bottom: 0;
}

.review-rte ul,
.review-rte ol {
    margin: 0 0 6px;
    padding-inline-start: 20px;
}
