/* ── Wrapper ──────────────────────────────────────────── */
#ic-therapy-soap-wrapper {
    max-width: 820px;
    margin: 30px auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
}

.ic-therapy-form-container {
    background: #ffffff;
    padding: 36px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ── Form Header ─────────────────────────────────────── */
.ic-form-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 3px solid #1a3a7a;
}

.ic-logo {
    max-height: 110px;
    width: auto;
    margin-bottom: 10px;
}

.ic-form-header h2 {
    color: #1a3a7a;
    font-size: 22px;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── Sections ────────────────────────────────────────── */
.form-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.form-section:last-of-type {
    border-bottom: none;
}

/* ── Rows & Labels ───────────────────────────────────── */
.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.req {
    color: #e03434;
}

.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="time"],
.form-row textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    color: #222;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #1a3a7a;
    background: #fff;
}

.form-row textarea {
    resize: vertical;
    line-height: 1.6;
}

/* ── Time Row ────────────────────────────────────────── */
.time-row {
    display: flex;
    gap: 24px;
}

.time-row > div {
    flex: 1;
}

/* ── SOAP Labels ─────────────────────────────────────── */
.soap-section .form-row label {
    font-size: 15px;
    color: #1a3a7a;
}

.soap-letter {
    display: inline-block;
    font-size: 18px;
    font-weight: 800;
    color: #1a3a7a;
    margin-right: 2px;
}

/* ── Signature Section ───────────────────────────────── */
.sig-heading {
    color: #1a3a7a;
    font-size: 17px;
    margin: 0 0 18px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.sig-row {
    display: flex;
    gap: 30px;
}

.signature-block {
    flex: 1;
}

.signature-block > label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.canvas-wrapper {
    position: relative;
    border: 2px solid #1a3a7a;
    border-radius: 6px;
    background: #f4f7ff;
    overflow: hidden;
}

.canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 130px;
    cursor: crosshair;
    touch-action: none;
}

.clear-sig-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    padding: 4px 11px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
    z-index: 10;
}

.clear-sig-btn:hover {
    background: #b02a37;
}

.sig-date-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sig-date-row label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    margin: 0;
}

.sig-date-row input[type="date"] {
    flex: 1;
    padding: 7px 10px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    background: #fafafa;
    box-sizing: border-box;
}

.sig-date-row input[type="date"]:focus {
    outline: none;
    border-color: #1a3a7a;
}

/* ── Error ───────────────────────────────────────────── */
.form-error {
    background: #fff0f0;
    border: 1px solid #e03434;
    color: #c00;
    border-radius: 5px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ── Generate Buttons ────────────────────────────────── */
.form-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
}

.generate-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 7px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    color: #fff;
}

.generate-btn-pdf {
    background: #1a3a7a;
}
.generate-btn-pdf:hover  { background: #0d2456; }

.generate-btn-word {
    background: #1f6c2e;
}
.generate-btn-word:hover { background: #145220; }

.generate-btn:active   { transform: scale(0.99); }
.generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 500px) {
    .form-actions { flex-direction: column; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .ic-therapy-form-container {
        padding: 22px 18px;
    }

    .time-row {
        flex-direction: column;
        gap: 0;
    }

    .sig-row {
        flex-direction: column;
        gap: 24px;
    }
}
