* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    background: #f4f5f7;
    color: #1a1a1a;
}

.app {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.app-header h1 {
    font-size: 28px;
    margin: 8px 0 24px;
    color: #1f2937;
}

/* ------------------ Tabs ------------------ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 24px;
}

.tab {
    appearance: none;
    background: transparent;
    border: none;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.tab:hover {
    color: #111827;
}

.tab.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ------------------ Form ------------------ */
.form {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-row label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=number],
.form-row input[type=date],
.form-row select {
    padding: 9px 11px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}

.standin-other {
    border-left: 3px solid #e5e7eb;
    padding-left: 14px;
    margin-bottom: 16px;
}

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

.btn-primary {
    appearance: none;
    border: none;
    background: #1d4ed8;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    appearance: none;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* ------------------ Output ------------------ */
.output {
    margin-top: 24px;
    background: #fff;
    padding: 20px 24px 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.output .info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 12px 14px;
    border-radius: 6px;
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
}

.output-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.copy-status {
    font-size: 13px;
    color: #059669;
}

.separator {
    border: none;
    border-top: 1px solid #d1d5db;
    margin: 16px 0;
}

.rendered-signature {
    padding: 8px 0;
}

.rendered-text {
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    color: #1f2937;
}

/* ------------------ Utils ------------------ */
.hidden {
    display: none !important;
}

@media (max-width: 540px) {
    .app {
        padding: 16px 12px 48px;
    }

    .form, .output {
        padding: 16px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 14px;
    }
}
