/* Custom styles for the Split Sheet Contract Plugin */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
}

#ss-form-wrapper {
    /* Prevents theme styles from interfering too much. */
    box-sizing: border-box; 
}

#ss-form-wrapper * {
    box-sizing: border-box;
}

/* Hide all h1 elements (including those with 'sign' text) */
h1 {
    display: none !important;
}

/* --- FIX FOR INVISIBLE TEXT (Inputs & Labels) --- */
.form-container .input-field,
.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="date"],
.form-container input[type="number"],
.form-container textarea,
.form-container select {
    color: #1f2937 !important; /* Force dark gray color for typed text */
}

.form-container label span {
    color: #374151 !important; /* Force dark gray for label text */
}

.form-container select option {
     color: #1f2937 !important; /* Ensures dropdown options are also visible */
}

.form-container .input-field::placeholder {
    color: #9ca3af; /* A lighter gray for the placeholder text */
}
/* --- END OF FIX --- */


/* --- FIX FOR INVISIBLE HEADINGS & PARAGRAPHS (UPDATED) --- */
/* This section targets specific text elements that the theme is making white. */
.form-container .bg-indigo-50 h3,
.form-container .bg-indigo-50 p,
.form-container .bg-white h4,
.form-container .text-sm p,
.form-container .text-sm strong,
.form-container h3,
.form-container h4 {
    color: #1f2937 !important; /* Force a dark gray color */
}

/* Force all labels to be bold and visible */
.form-container label {
    color: #374151 !important;
    font-weight: 700 !important; /* Same as font-bold */
}
/* --- END OF FIX --- */

/* --- CENTER TEXT FIXES --- */
/* Center the header subtitle text */
.form-header p {
    text-align: center !important;
}

/* Center the step 3 description text */
.bg-indigo-50 p {
    text-align: center !important;
}
/* --- END OF CENTER TEXT FIXES --- */

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(to right bottom, #ffffff, #f8fafc);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(209, 213, 219, 0.3);
}

.form-header {
    background: linear-gradient(to right, #4f46e5, #6366f1);
    border-radius: 16px 16px 0 0;
}

.input-field {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.input-field.invalid {
    border-color: #ef4444; /* Red border for invalid fields */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-field:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    background: linear-gradient(to right, #4f46e5, #6366f1);
    transition: all 0.3s ease;
    position: relative;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:disabled {
    background: #a5b4fc;
    cursor: not-allowed;
}

.btn-secondary {
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
}

.signature-pad {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    position: relative;
}
.signature-pad.invalid {
    border-color: #ef4444;
}

.signature-pad canvas {
    width: 100%;
    height: 180px;
    border-radius: 0.5rem;
}

.clear-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

.form-progress {
    position: sticky;
    top: 0;
    z-index: 100;
}

.progress-step {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.4s ease;
}

.step-active {
    background-color: #4f46e5;
    color: white;
    transform: scale(1.1);
}

.step-completed {
    background-color: #10b981;
    color: white;
}

.step-inactive {
    background-color: #e5e7eb;
    color: #6b7280;
}

.step-line {
    flex-grow: 1;
    height: 2px;
}

/* Spinner for submit button */
.spinner-border {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: text-bottom;
    border: .2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    -webkit-animation: spinner-border .75s linear infinite;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* AJAX Message styles */
#ss-form-messages {
    border-radius: 8px;
    color: #fff;
}
#ss-form-messages.success {
    background-color: #28a745;
}
#ss-form-messages.error {
    background-color: #dc3545;
}