@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* General Styles */
:root {
    --primary-color: #28a745; /* Green color */
    --secondary-color: #f4f7f6;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ccc;
    --bg-white: #fff;
    --btn-primary-hover: #218838; /* Darker green on hover */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-color);
    margin: 0;
    min-height: 100vh;
    color: var(--text-dark);
}

/* New CSS to prevent scrolling on the splash screen */
body.splash-active {
    overflow: hidden;
}

/* Page Transitions and Layout */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--secondary-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    padding: 20px;
    box-sizing: border-box;
    display: flex; /* For centering content */
    justify-content: center;
    align-items: center;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* Form page now allows scrolling within its container if content overflows */
#form-page {
    position: relative; /* Relative positioning is better for a scrollable page */
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Ensures content is centered vertically on screens taller than the form */
    width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
}

/* Splash Screen */
.splash-content {
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.logo-animation {
    max-width: 250px;
    height: 250px;
    animation: scaleIn 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.splash-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 20px 0 5px;
    animation: textUp 0.6s 0.2s ease-out backwards;
}

.splash-content p {
    font-size: 1.2em;
    color: var(--text-light);
    margin-bottom: 30px;
    animation: textUp 0.6s 0.4s ease-out backwards;
}

.start-form-btn {
    padding: 15px 40px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: scaleIn 0.8s 0.6s ease-out backwards;
}

.start-form-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Form Container */
.form-container {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
    animation: slideInFromTop 0.8s ease-out backwards;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h2 {
    font-size: 1.8em;
    font-weight: 600;
}

.header .logo{
    width: 180px;
    height: 180px;
}

.header p.description {
    font-size: 0.9em;
    color: var(--text-light);
    line-height: 1.6;
}

/* Form Steps & Inputs */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.progress-indicator .step {
    width: 15px;
    height: 15px;
    background-color: #ccc;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.progress-indicator .step.active {
    background-color: var(--primary-color);
}

h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

input, select, textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
    outline: none;
}

/* New style for the optional input field */
.hidden-input-field {
    display: none;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.next-step-btn, .prev-step-btn, .submit-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
}

.next-step-btn, .submit-btn {
    background-color: var(--primary-color);
    color: #fff;
}

.next-step-btn:hover, .submit-btn:hover {
    background-color: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.prev-step-btn {
    background-color: #e0e0e0;
    color: #555;
}

.prev-step-btn:hover {
    background-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: translateY(0);
    box-shadow: none;
}

.clear-signature-btn {
    padding: 8px 15px;
    background-color: transparent;
    border: 1px solid #ccc;
    color: #555;
    font-size: 0.8em;
    border-radius: 20px;
}

/* Terms & Conditions Section */
.terms-scroll {
    border: 1px solid var(--border-color);
    padding: 15px;
    max-height: 200px;
    overflow-y: scroll;
    background-color: #fafafa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-light);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    font-size: 0.95em;
}

/* Signature Pad */
.signature-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.signature-pad canvas {
    background-color: #f9f9f9;
    border-radius: 8px;
}

.signature-pad p {
    font-size: 0.9em;
    color: var(--text-light);
    margin: 10px 0 5px;
}

/* Thank You Page */
.thank-you-content {
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.thank-you-content h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 15px;
}

.thank-you-content p {
    font-size: 1.1em;
    color: var(--text-light);
}

/* Checkmark Animation */
.checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #7ac142;
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
    position: relative;
    background-color: #7ac142;
    margin: 0 auto 30px;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #7ac142;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes textUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInFromTop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #7ac142;
    }
}

/* Mobile-Specific Styles */
@media (max-width: 768px) {
    .page {
        padding: 10px;
    }
    .form-container {
        padding: 20px;
    }
    .input-group-row {
        flex-direction: column;
        gap: 0;
    }
    .input-group-row input, .input-group-row select {
        margin-bottom: 10px;
    }
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    .next-step-btn, .prev-step-btn, .submit-btn {
        width: 100%;
    }
}