/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000000;
    line-height: 1.6;
    background-color: #ffffff;
    padding: 10px;
    margin: 0;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Styles */
.header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #000000;
}

.header-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.image-section {
    flex: 0 0 40%;
    max-width: 40%;
}

.treatment-image {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    object-fit: cover;
    display: block;
}

.form-header-section {
    flex: 1;
    padding-left: 15px;
}

.logo-container {
    margin-bottom: 10px;
}

.logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
}

.main-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000000;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 0 5px 0;
    line-height: 1.2;
    white-space: nowrap;
}

.sub-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000000;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.header-form-section {
    margin-top: 15px;
}

.header-form-section .form-group {
    margin-bottom: 12px;
}

.header-form-section .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.header-form-section .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.header-form-section .form-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.header-form-section .form-input {
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: #ffffff;
    border: 2px solid #000000;
    transition: all 0.3s ease;
}

.header-form-section .form-input:focus {
    background-color: white;
    border-color: #000000;
    outline: none;
}

.header-form-section .form-input:not(:placeholder-shown) {
    background-color: #f0f0f0;
    border-color: #000000;
    color: #000000;
}

/* Form Styles */
.form {
    width: 100%;
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000000;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.section-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #000000;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #000000;
    font-size: 1rem;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000000;
    background-color: #ffffff;
    transition: all 0.3s ease;
    min-height: 48px; /* Minimum touch target size */
}

.form-input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.form-input:not(:placeholder-shown) {
    background-color: #f0f0f0;
    border-color: #000000;
    color: #000000;
}

.form-input:invalid {
    border-color: #000000;
    background-color: #ffffff;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #000000;
    background-color: #f0f0f0;
}

/* Submit Button */
.submit-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.submit-btn {
    background-color: #000000;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.submit-btn:hover {
    background-color: #333333;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Message Container */
.message-container {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
}

.message {
    font-weight: 600;
    font-size: 1rem;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #000;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #000;
}

/* Checkbox and Radio Styles */
.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
    padding: 8px;
    transition: background-color 0.2s ease;
    min-height: 44px; /* Minimum touch target size */
}

.checkbox-label:hover, .radio-label:hover {
    background-color: #ffffff;
}

.checkbox-label input[type="checkbox"], 
.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #000000;
}

.checkbox-text, .radio-text {
    flex: 1;
    font-size: 0.95rem;
    color: #000000;
}

/* Consent Section Styles */
.consent-text {
    background-color: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #000000;
}

.consent-text p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #000000;
    text-align: justify;
}

.consent-text p:last-child {
    margin-bottom: 0;
}

.consent-text p strong {
    color: #000000;
    font-weight: 700;
    font-size: 0.95rem;
}

.consent-checkbox {
    background-color: #ffffff;
    padding: 15px;
    border: 1px solid #000;
    margin-bottom: 15px;
}

.consent-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.consent-checkbox .checkbox-text {
    font-weight: 600;
    color: #000000;
}

/* Signature Section Styles */
.signature-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-left: 4px solid #000000;
}

.sig-wrap {
    margin-top: 15px;
    width: 100%;
    position: relative;
}

.sig-toolbar {
    margin-top: 12px;
    text-align: center;
    padding: 8px 0;
}

#sig-clear {
    background-color: #000000;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#sig-clear:hover {
    background-color: #333333;
}

#sig-clear:active {
    background-color: #2c5aa0;
    transform: translateY(1px);
}

#signature {
    border: 2px solid #000;
    background-color: white;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    width: 100% !important;
    height: 250px !important;
    max-width: 100%;
}

.signature-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* Company Information Styles */
.company-info {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 2px solid #000000;
}

.company-details {
    text-align: center;
}

.company-details h3 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000000;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.company-details p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
    color: #000000;
}

.company-details p:last-child {
    margin-bottom: 0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        padding: 15px;
        box-shadow: none;
        max-width: 100%;
    }

    .header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    /* Show mobile version, hide desktop version */
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .header-top-row {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        margin-bottom: 8px;
    }

    .image-section {
        flex: 0 0 25%;
        max-width: 25%;
        order: 1;
        text-align: left;
    }

    .header-title-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
        order: 2;
        justify-content: center;
        padding-left: 8px;
    }

    .form-header-section {
        width: 100%;
        order: 3;
        margin-top: 0;
    }
    
    .treatment-image {
        max-height: 180px;
        object-fit: cover;
        margin: 0;
    }

    #signature {
        height: 200px !important;
    }

    .main-title {
        font-size: 1.4rem;
        text-align: left;
        white-space: normal;
        line-height: 1.2;
        margin-bottom: 5px;
        font-weight: bold;
        color: #000000;
    }

    .sub-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .logo {
        max-width: 140px;
        margin: 0 0 4px 0;
        display: block;
        height: auto;
    }

    .header-form-section {
        margin-top: 8px;
    }

    .header-form-section .form-group {
        margin-bottom: 8px;
    }

    .header-form-section .form-label {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }

    .header-form-section .form-input {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-height: 32px;
    }

    .header-form-section .form-row {
        flex-direction: column;
        gap: 0;
    }

    .header-form-section .form-row .form-group {
        margin-bottom: 15px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 12px 30px;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }

    .consent-text {
        padding: 15px;
    }

    .consent-text p {
        font-size: 0.85rem;
        text-align: left;
    }

    .consent-checkbox {
        padding: 12px;
    }

    .signature-section {
        padding: 15px;
    }

    #signature {
        width: 100%;
        height: 120px;
    }

    #sig-clear {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .company-info {
        padding: 15px;
    }

    .company-details h3 {
        font-size: 1.2rem;
    }

    .company-details p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .header-content {
        gap: 8px;
        align-items: stretch;
    }

    .header-top-row {
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .image-section {
        flex: 0 0 25%;
        max-width: 25%;
        text-align: left;
    }
    
    .treatment-image {
        max-height: 100px;
        margin: 0;
    }
    
    .header-title-section {
        gap: 6px;
        padding-left: 6px;
    }

    .form-header-section {
        width: 100%;
        margin-top: 0;
    }

    .main-title {
        font-size: 1.3rem;
        margin-bottom: 5px;
        line-height: 1.2;
    }

    .sub-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .logo {
        max-width: 120px;
        margin: 0 0 4px 0;
    }

    .header-form-section {
        margin-top: 6px;
    }

    .header-form-section .form-group {
        margin-bottom: 6px;
    }

    .header-form-section .form-label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .header-form-section .form-input {
        padding: 4px 6px;
        font-size: 0.75rem;
        min-height: 28px;
    }

    #signature {
        height: 150px !important;
    }

    .main-title {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logo {
        max-width: 100px;
    }

    .header-form-section .form-input {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .header-form-section .form-label {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .form-input {
        padding: 8px 10px;
    }

    .submit-btn {
        padding: 10px 25px;
    }

    .consent-text {
        padding: 12px;
    }

    .consent-text p {
        font-size: 0.8rem;
    }

    .consent-checkbox {
        padding: 10px;
    }

    .signature-section {
        padding: 12px;
    }

    #signature {
        height: 100px;
    }

    #sig-clear {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .company-info {
        padding: 12px;
    }

    .company-details h3 {
        font-size: 1.1rem;
    }

    .company-details p {
        font-size: 0.85rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container {
        padding: 8px;
    }

    .header-top-row {
        gap: 6px;
        margin-bottom: 4px;
    }

    .image-section {
        flex: 0 0 22%;
        max-width: 22%;
        text-align: left;
    }
    
    .treatment-image {
        max-height: 70px;
        margin: 0;
        border-radius: 3px;
    }
    
    .header-title-section {
        gap: 4px;
        padding-left: 4px;
    }

    .form-header-section {
        width: 100%;
        margin-top: 0;
    }
    
    .main-title {
        font-size: 1.1rem;
        margin-bottom: 5px;
        line-height: 1.2;
    }

    .sub-title {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .logo {
        max-width: 100px;
        margin: 0 0 3px 0;
    }

    .header-form-section {
        margin-top: 4px;
    }

    .header-form-section .form-group {
        margin-bottom: 4px;
    }

    .header-form-section .form-label {
        font-size: 0.7rem;
        margin-bottom: 1px;
    }

    .header-form-section .form-input {
        padding: 3px 4px;
        font-size: 0.7rem;
        min-height: 24px;
    }

    #signature {
        height: 120px !important;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 5px;
    }

    .header-top-row {
        gap: 4px;
        margin-bottom: 3px;
    }

    .image-section {
        flex: 0 0 20%;
        max-width: 20%;
        text-align: left;
    }
    
    .treatment-image {
        max-height: 55px;
        margin: 0;
        border-radius: 2px;
    }
    
    .header-title-section {
        gap: 3px;
        padding-left: 3px;
    }

    .form-header-section {
        width: 100%;
        margin-top: 0;
    }
    
    .main-title {
        font-size: 1rem;
        margin-bottom: 5px;
        line-height: 1.2;
    }

    .sub-title {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .logo {
        max-width: 80px;
        margin: 0 0 2px 0;
    }

    .header-form-section {
        margin-top: 3px;
    }

    .header-form-section .form-group {
        margin-bottom: 3px;
    }

    .header-form-section .form-label {
        font-size: 0.65rem;
        margin-bottom: 1px;
    }

    .header-form-section .form-input {
        padding: 2px 3px;
        font-size: 0.65rem;
        min-height: 20px;
    }

    #signature {
        height: 100px !important;
    }
}

/* Desktop and Large Screens */
@media (min-width: 769px) {
    .header-content {
        flex-direction: row;
        gap: 20px;
        align-items: flex-start;
    }

    /* Show desktop version, hide mobile version */
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }

    .header-top-row {
        display: none;
    }

    .image-section.desktop-only {
        flex: 0 0 40%;
        max-width: 40%;
    }

    .form-header-section.desktop-only {
        flex: 1;
        padding-left: 15px;
        width: auto;
        margin-top: 0;
    }

    .treatment-image {
        max-height: none;
        object-fit: contain;
    }
}

/* Error States */
.form-input.error, .form-textarea.error {
    border-color: #000000;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.checkbox-label input[type="checkbox"].error,
.radio-label input[type="radio"].error {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

.radio-group .radio-label input[type="radio"].error + .radio-text,
.checkbox-group .checkbox-label input[type="checkbox"].error + .checkbox-text {
    color: #666;
    font-weight: 600;
}

/* Print Styles */
@media print {
    .container {
        box-shadow: none;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .submit-container {
        display: none;
    }

    .message-container {
        display: none;
    }

    .form-input, .form-textarea {
        border: 1px solid #000;
        background-color: white;
    }

    .checkbox-group, .radio-group {
        break-inside: avoid;
    }

    .consent-text {
        background-color: white;
        border: 1px solid #000;
    }
}
