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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #E86441;
}

.header-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.radio-group label:hover {
    background-color: #f5f5f5;
}

.radio-group input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.certification-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.certification-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.certification-text {
    font-weight: 600;
    margin-bottom: 10px;
    color: #444;
}

.certification-list {
    margin-left: 20px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #555;
}

.certification-list li {
    margin-bottom: 10px;
}

.form-group input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.signature-section {
    margin: 30px 0;
    padding: 25px;
    background: #f9f9f9;
   
}

.signature-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.signature-section p {
    color: #666;
    margin-bottom: 15px;
}

.signature-pad-container {
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    cursor: crosshair;
    overflow: hidden;
}

#signatureCanvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}

.signature-controls {
    display: flex;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #E86441;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-primary:hover {
    background: #d05436;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(232, 100, 65, 0.4);
}

.btn-secondary {
    background: #E86441;
    color: white;
}

.btn-secondary:hover {
    background: #d05436;
}

.form-actions {
    margin-top: 30px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 1.2em;
    font-weight: 600;
}

/* Tablet and Mobile Responsive Design */
@media (max-width: 1024px) {
    body {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 8px;
    }

    header {
        margin-bottom: 30px;
        padding-bottom: 15px;
    }

    .header-logo {
        max-width: 140px;
    }

    header h1 {
        font-size: 1.8em;
    }

    header p {
        font-size: 1em;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group input[type="text"],
    .form-group input[type="date"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .signature-pad-container {
        width: 100%;
        overflow-x: hidden;
    }

    #signatureCanvas {
        width: 100% !important;
        height: 150px !important;
        max-width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 15px 20px;
        font-size: 1em;
    }

    .form-selector-content {
        padding: 30px 20px;
        width: 95%;
    }

    .form-selector-content h2 {
        font-size: 1.5em;
    }

    .selector-logo {
        max-width: 120px;
    }

    .certification-text,
    .certification-list {
        font-size: 0.9em;
    }

    .signature-controls {
        justify-content: center;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 15px;
        border-radius: 5px;
    }

    header {
        margin-bottom: 20px;
    }

    .header-logo {
        max-width: 120px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 0.9em;
    }

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

    .form-group label {
        font-size: 0.9em;
    }

    #signatureCanvas {
        height: 120px !important;
    }

    .form-selector-content {
        padding: 20px 15px;
    }

    .form-selector-content h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }

    .selector-logo {
        max-width: 100px;
        margin-bottom: 20px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 15px;
        font-size: 0.95em;
    }
}

/* Landscape orientation on phones */
@media (max-width: 768px) and (orientation: landscape) {
    #signatureCanvas {
        height: 100px !important;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .radio-group label,
    input[type="checkbox"],
    input[type="radio"] {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(232, 100, 65, 0.2);
    }

    .btn-primary,
    .btn-secondary {
        -webkit-tap-highlight-color: rgba(232, 100, 65, 0.3);
    }
}

/* Form Selector Overlay */
.form-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.form-selector-content {
    background: white;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.selector-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 30px;
}

.form-selector-content h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 30px;
}

.form-dropdown-group {
    margin-bottom: 30px;
    text-align: left;
}

.form-dropdown-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 1em;
}

.form-select {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-select:focus {
    outline: none;
    border-color: #E86441;
}

.form-select option:disabled {
    color: #999;
}
